Java Smart Ticket Demo 1.1

These instructions provide steps for setting up and running the Java Smart Ticket demo on WebLogic Server.

  1. Download the Smart Ticket demo application source code at Sun's Website: http://developer.java.sun.com/developer/releases/smarticket/. Extract it into a new directory on your machine; from now on we will call this directory SMARTICKET_HOME.

  2. Download the Sun Wireless toolkit at: http://java.sun.com/products/j2mewtoolkit/download.html. Install the toolkit; during installation you will be prompted to point to a JDK, you can select the JDK included in your BEA_HOME/jdk131 directory.

  3. Download the smarticket-patch.zip from BEA. This patch provides the WebLogic descriptors that allow you to run the Smart Ticket Demo on WebLogic Server. Extract this zip file in the directory SMARTICKET_HOME/smarticket.

  4. Set up your development environment. Running the setExamplesEnv script in WL_HOME/samples/server/config/examples will do this for you. WL_HOME is the home location of your WebLogic installation, by default, WL_HOME is c:/bea/weblogic700.

  5. Set your environment to also include the J2MEWTK_HOME variable which specifies the home of your Wireless Toolkit. Point to the root directory of where you installed the toolkit. For example, type:

    set J2MEWTK_HOME=c:\j2mewtk

  6. In your development shell run the ant build script that has been provided for you in the SMARTICKET_HOME/smarticket directory. In this directory run the build script by typing:

    localant

  7. WebLogic Server comes with a demonstration PointBase database. To upload the necessary data to this database, you must first have PointBase running. Boot up your Examples server and PointBase will begin automatically. Check the SMARTICKET_HOME/smarticket/populate.bat script to make sure it is pointing to the correct POINTBASEHOME; this should be set to your WL_HOME/samples/server/eval/pointbase directory. Then run the SMARTICKET_HOME/smarticket/populate.bat script by typing the following in your development shell from the SMARTICKET_HOME/smarticket directory:

    populate

  8. Now you must configure your Data Sources for each of the four EJBs the Smart Ticket application uses. Start your WebLogic Examples Server and once it is running, open the Administration Console by pointing a browser to http://localhost:7001/console.

  9. Under the JDBC heading in the main home page of the Administration Console, click on 'Tx Data Sources' and go to the 'Configure a new JDBC Tx Data Source' tab. Enter a name for the data source, the first one is: MovieInfoData. Then enter MovieInfoDataSource in the JNDI field. Enter demoPool as your Pool Name; this is the default connection pool the WebLogic examples use. Click on 'Create.' Click on the Targets Tab. Choose the examplesServer in the 'Available' column and click on the right arrow to target it. Click 'Apply.'

  10. Repeat the above step for the other three datasources this application requires. The names of the remaining three sources are: TicketSalesData, CustomerData, and LocaleInfoData. Their corresponding JNDI names are: TicketSalesDataSource, CustomerDataSource, and LocaleInfoDataSource. Each uses the demoPool as the Pool Name.

  11. Now you must install the Smart Ticket application on WebLogic Server. Click on the picture of the house at the top of the Administration Console page to return to the Console Home. Under the 'Your deployed resources' heading, click on 'Applications.' Then click on the 'Configure a new application' link. Browse to your SMARTICKET_HOME/ smarticket/bin directory and select the smarticket.ear file.

  12. Highlight the examplesServer and click on the right arrow to target the application to the examplesServer. Click 'Create.' Wait a moment until the components of the application have deployed. A configuration tab will appear for your newly installed application. Click 'Apply' once more.

  13. You must edit the Smart Ticket client to point to the proper host name and port on which your WebLogic Server is running. With an editor modify the smarticket.jad file located in the SMARTICKET_HOME/smarticket/bin directory and change the following three lines to point to the correct location of your server:

    SMARTicket-Poster-URL: http://localhost:7001/SmarTicketApp/
    SMARTicket-Servlet-URL: http://localhost:7001/SmarTicketApp/servlet/
    SMARTicket-Splash-URL: http://localhost:7001/SmarTicketApp/

  14. Open the smarticket.jad file in the SMARTICKET_HOME/bin directory

  15. Sign In! For further instructions on running the SmartTicket demo, refer to the documentation provide in the SMARTICKET_HOME/doc directory.

Notes

When creating a user account for the SmartTicket Application, enter in 95130 or 95054 for your zip code; also, your password must be 6 characters long. Try selecting the 'Poster' mode when you create an account, this will enable your phone or emulator to view a picture of the movie you choose to see.

There are several options available for using the emulator. go into your J2ME Wireless Ticket and manipulate the default device and preferences.

If you have run the client Smart Ticket Application before and are redploying the application on WebLogic, you will have to clear the database of the previous users information. To do so, run the J2ME Wireless Ticket Utility which is available from the Windows start menu. Click on 'Clean Database'. Then restart the Smart Ticket Client.