Java[tm] Smart Ticket Sample Application 1.2 > Running the Pre-Built Sample Application

Running the Pre-Built Sample Application

These instructions describe how to run the sample application using the J2EE Application Server and the J2ME Wireless Toolkit on a single machine. The sample application bundle includes pre-built binaries that you can use to run the sample application. If you make any modifications to the source code, you'll need to follow a different set of instructions on building the application.

Ensure Application Server and Pointbase are installed and running by checking here

Run the asant using build.xml file to install and configure database resources, and deploy the applications.

Open a shell prompt and enter these commands:

cd <smartticket.home>/src

asant deploy



NOTE: Before redeploying, you must first execute the command asant undeploy to clean up the existing files resulted from the initial deployment.

Verifying Deployment

As an optional step, you can use the Application Server Administration Tool to verify that the application has been registered.

To verify the registration of the application, do the following:

Execute the command asadmin list-components to look at applications deployed with a server instance. For example:

<install_dir>/bin/asadmin list-components --user <username> --password <password> 

You will see the smartticket applications listed:

Populate Database

Using your Web browser, visit http://localhost:8080/smartticket/. If your browser is configured to use a proxy, make sure that your browser does not use the proxy to access localhost.

Click the link to populate the database. This link points to http://localhost:8080/smartticket/admin/populating.jsp?forcefully=false. The browser will let you know when the database has been successfully populated.

If you install your appserver at a different port than the default port 8080, follow instructions on configuring the application.

Run the asant using build.xml file to start the J2ME Wireless Tookit Emulator.

Open a shell prompt and enter these commands:

cd <smartticket.home>/src

You must first set the J2MEWTK.HOME in <smartticket.home>/src/build.properties to the root directory of your J2ME Wireless Toolkit installation. For example, if you installed the toolkit in /usr/local/java/wtk104 or c:/wtk104 (use Unix format slash "/" as the file separator in build.properties for all platforms), then that path should be the value of J2MEWTK.HOME.

If you install your appserver at a different port than the default port 8080, follow instructions on configuring the application.

Start the Wiresless Toolkit Emulator:

asant emulate

A phone emulator will appear, showing the Java Smart Ticket Sample Application splash screen.

You can now use the application.


© 2002, 2003 Sun Microsystems, Inc. All rights reserved.