WebLogic Builder Online Help
This tutorial shows you how to rapidly deploy Sun's BluePrint wireless application Smart Ticket to WebLogic Server using the WebLogic Builder utility. WebLogic Builder is a visual environment that enables you to generate and edit deployment descriptor files. Smart Ticket is a J2EE application that lets you browse and purchase movie tickets using a wireless device such as a cell phone. Smart Ticket has both web application and EJB components.
In particular, the tutorial shows how to:
This tutorial contains the following sections:
Before starting this tutorial:
Follow these steps to deploy Smart Ticket on WebLogic Server.
In this step you install Smart Ticket and J2ME, Sun's Wireless Toolkit. You also set up your environment so you can build the application.
Download WebLogic Server 8.1 from http://www.bea.com
and install it. The WebLogic Server installation directory, c:\bea\weblogic810
unless you specify another location, is called WL_HOME
.
Download the Smart Ticket demo application source code at http://developer.java.sun.com/developer/releases/smarticket/. Extract it into a new directory on the same machine or accessible from WL_HOME
. We will call this directory SMARTICKET_HOME
.
Download the Sun Wireless toolkit at: http://java.sun.com/products/j2mewtoolkit/download.html. Install the toolkit. During installation you will be prompted to select a JDK. You can select the JDK included in your BEA_HOME/jdk141
directory.
J2MEWTK_HOME=C:\J2mewtk
, assuming C:\J2mewtk
is where you installed J2ME. Note: if you do not set J2MEWTK_HOME
, you will not be able to build the application. setExamplesEnv
script located in WL_HOME\samples\domains\examples
. In this sequence, WebLogic Builder reads the deployment descriptor files that are included with the Smart Ticket application and introspects the application's .class
files to create the deployment descriptor files that help an application to run on WebLogic Server.
WebLogic Builder will not overwrite the application's existing deployment descriptor files.
SMARTICKET_HOME \build\server
and click Open. A dialog asks: "Unable to locate deployment descriptors. Would you like deployment descriptors created for you?" Click Yes to have WebLogic Builder introspect the Smart Ticket class files and generate weblogic.xml
and weblogic-ejb-jar.xml
. In this step, you set the Smart Ticket web application's context path using the <context-root>
element.
Now the application's <context-root>
element is specified.
In this sequence, you assign JNDI names to references in the web application and in EJBs so that the data in the entity beans is accessible from the web application.
In this step, start the Examples server and use the WebLogic Server Administration Console to configure the Data Sources for each of the four EJBs the Smart Ticket application uses. Also in this step, replace Smart Ticket's Cloudscape database with the Pointbase RDBMS included with WebLogic Server.
The JNDI names for the data sources must match the JNDI names for the web application resource references and the EJB resources you set in Step 4.
weblogic
and password weblogic
. MyCustomerDataSource
. Enter CustomerDataSource
in the JNDI field. Enter demoPool
as your Pool Name; this is the default connection pool that WebLogic Server examples use. Click Create. MyMovieInfoDataSource
, MyLocaleInfoDataSource
, and MyTicketSalesDataSource
). SMARTICKET_HOME\smarticket\populate.bat
: set POINTBASEHOME=%SAMPLES_HOME%\server\eval\pointbase
java utils.Schema jdbc:pointbase:server://localhost/demo,database.home=%POINTBASEHOME% com.pointbase.jdbc.jdbcUniversalDriver -u examples -p examples -verbose ./src/smarticketPointBase.sql
smarticket.sql
Pointbase friendly by replacing it with a script that substitutes "int" data types with "integer." Extract smarticketPointBase.sql
from http://download.oracle.com/docs/cd/E13222_01/wls/docs81/quickstart/smarticket-patch.zip and copy it into SMARTICKET_HOME\smarticket\src
.Now you are ready to deploy and run Smart Ticket on the WebLogic Server 8.1 Examples Server.
SMARTICKET_HOME\bin\smarticket.jad
, by replacing the given port number (8000) with the port number of the Examples server, which by default is 7001. When creating a user account for the Smart Ticket Application, enter 95130 or 95054 for your zip code. Your password must be six characters long.
Try selecting the 'Poster' mode when you create an account; this will enable your phone or other wireless emulator to display a preview poster for the movies as you browse them.
WebLogic Builder is a visual environment for generating and editing an application's deployment descriptor files. You can view descriptor files while you visually edit them in WebLogic Builder, and you won't need to make textual edits to the XML. See WebLogic Builder.
The sample application Smart Ticket illustrates how the J2EE platform interoperates with the J2ME platform to create enterprise applications that serve mobile client devices, such as cell phones, two-way pagers, and palmtops.
View the progress and status of the Smart Ticket application on WebLogic Server by monitoring the Launch Examples Server command window that appeared when you started the server.
When selecting a device emulator from the J2ME Wireless Toolkit's Default Device menu, the DefaultGreyPhone is the easiest to work with.
If you are redeploying the Smart Ticket application, clear the database of the previous user's information. To do so:
See the procedure for porting Smart Ticket to WebLogic Server 8.1 without using WebLogic Builder: Java Smart Ticket Demo 1.1 at http://download.oracle.com/docs/cd/E13222_01/wls/docs81/quickstart/smarticket.html.