Step 1: Check for System Requirements
Step 2: Download and Install the BEA WebLogic Server
Step 3: Download the Java Pet Store from Sun Microsystems
Step 4: Download the WebLogic Server Pet Store 1.1.2 Patch
Step 5: Set Up a Development Environment
Step 6: Build the WebLogic Java Pet Store
Step 7: Copy the EAR file to the WebLogic Home Directory
Step 8: Start the WebLogic Server with the Examples Configuration
Step 9: Open the WebLogic Administration Console
Step 10: Create a Connection Pool for the Cloudscape Database
Step 11: Create Three New JDBC Data Sources
Step 12: Set Up for an Oracle or Sybase Database (Optional)
Step 13: Start the WebLogic Pet Store
Notes
Step 1: Check for System Requirements
You need to install Version 6.1 of the WebLogic Server.
You can use either the J2EE 1.2 certified version or the
version with J2EE 1.3 features.
The WebLogic Pet Store is essentially the same as Sun's
Java Pet Store. However, it has extra deployment descriptors
that are specific to WebLogic Server 6.1, Ant 1.2, and
build scripts modified for Ant.
Before you install the WebLogic Server, check your system
for the required software:
The Java 2 Platform, Standard Edition 1.3.1 (JDK 1.3.1)
is installed automatically with the WebLogic Server.
The WebLogic Pet Store patch also installs Ant 1.2,
a Java-based build tool created by the
Jakarta project.
Step 2: Download and Install the BEA WebLogic Server
To install the server:
- Download Version 6.1 from
http://commerce.bea.com.
- Register as a BEA WebLogic Developer, if you haven't already.
- The directory in which you install the WebLogic Server
is your WebLogic home (called here weblogic).
- Quick Install: Click the executable
file and move through the Installer steps.
- Or, use the more complete instructions at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61/install/index.html.
- During installation, choose a password. Remember it.
Step 3: Download the Java Pet Store from Sun Microsystems
- Download the Java Pet Store from the
Sun Java Developer Connection.
- Register for the Java Developer Connection, or if you are already registered, enter
your name and password.
- Download Version 1.1.2 of the Java Pet Store. The download file is named jps-1_1_2.zip.
- Create a directory for the Pet Store outside of your WebLogic home directory.
- Unzip jps-1_1_2.zip to your Pet Store home directory,
(called here petStoreHome),
using whatever tools are available on your system.
This is not the same as the version of Pet Store that ships with
the WebLogic Server in
weblogic\samples\petStore.
Step 4: Download the WebLogic Server Pet Store Patch
- Download the WebLogic Pet Store patch for
Windows or
Unix.
- Unzip it to petStoreHome, the directory above
the Pet Store files (the Pet Store files are in petStoreHome\jps1.1.2).
- If you zip utility asks you to confirm overwriting files, click
Yes or Yes to All.
- In petStoreHome\jps1.1.2\src\petstore\src\docroot,
delete changeaddressform.jsp and changepreferencesform.jsp.
These files are replaced with changeaddressform
and changepreferencesform from the patch.
Step 5: Set Up a Development Environment
- Open a command window.
- Move to the WebLogic examples domain:
cd weblogic\config\examples
- Run the script that sets up your development environment:
- On Windows: setExamplesEnv
- On UNIX Bourne shell: . setExamplesEnv.sh
This command window is now your development environment.
- Enter env and check the value of your
CLASSPATH variable.
If you are using the J2EE 1.2
version of WebLogic Server, the first item in CLASSPATH
should be a path to j2ee12.jar.
However, on the J2EE 1.3
version of WebLogic Server, you won't see
j2ee12.jar in the CLASSPATH at all.
Step 6: Build the WebLogic Java Pet Store
- In your development environment window, move to the
Pet Store source directory:
cd petStoreHome\jps1.1.2\src\petstore\src
- Run the build script installed by the patch:
- On Windows: build
- On UNIX Bourne shell: sh build.sh
- Move to the build directory: cd ..\build
- Look for the file petstore.ear
Step 7: Copy the EAR file to the WebLogic Home Directory
- Place the EAR file in the applications directory
of the examples domain:
- On Windows: copy petstore.ear weblogic\config\examples\applications,
or use the Windows Explorer.
- On Solaris: cp petstore.ear weblogic/config/examples/applications
Step 8: Start the WebLogic Server with the Examples Configuration
- Move to the examples domain in
your WebLogic home directory: cd weblogic\config\examples
- Use a script to start the server:
- On Windows - startExamplesServer
- On UNIX Bourne shell: sh startExamplesServer.sh
- When prompted, enter the password you chose when you installed
the WebLogic Server.
Step 9: Open the WebLogic Administration Console
- Open a Web browser.
- Go to the URL http://localhost:7001/console, or
- Use the hostname you chose when you installed WebLogic Server.
- Use the listen connection port you chose when you installed WebLogic Server.
- When prompted, enter the user name and password you chose when
you installed WebLogic Server.
Step 10: Create a Connection Pool for the Cloudscape Database
If you are using an Oracle or Sybase database,
please see also
- In the left pane, expand Services > JDBC.
- Click Connection Pools.
- In the right pane, click Configure a New JDBC Connection Pool.
- Enter these values:
- Name: petstorePool
- URL: jdbc:cloudscape:petStore
- Driver: COM.cloudscape.core.JDBCDriver
- Properties: user=none
password=none
server=none
For Properties, enter a carriage return
between each value.
- Click Create.
- Click the Targets tab.
- Move examplesServer to the Chosen (right) column.
- Click Apply.
Step 11: Create Three New JDBC Data Sources
For the first data source:
- Click the Home icon in the upper right of the Administration Console.
- In the left pane, expand Services > JDBC..
- Click Data Sources.
- In the right pane, click Configure a New JDBC Data Source.
- For Name, enter EstoreDB.
- For JNDI Name, enter jdbc.EstoreDB.
- For Pool Name, enter petstorePool.
- Click Create.
- Click the Targets tab.
- Move examplesServer to the Chosen (right) column.
- Click Apply.
- To check the current list of data sources, click
Home, then JDBC > Data Sources.
For the second data source:
- For Name, enter InventoryDB.
- For JNDI Name, enter jdbc.InventoryDB.
- For Pool Name, enter petstorePool.
- Click Create.
- Click the Targets tab.
- Move examplesServer to the Chosen (right) column.
- Click Apply.
For the third data source:
- For Name, enter SignOnDB.
- For JNDI Name, enter jdbc.SignOnDB.
- For Pool Name, enter petstorePool.
- Click Create.
- Click the Targets tab.
- Move examplesServer to the Chosen (right) column.
- Click Apply.
Step 12: Set Up for an Oracle or Sybase Database (Optional)
If you are using a database other than Cloudscape, such as Oracle or Sybase,
you need to build the database and then change a value
in customer_ejb.xml.
To build the database, you can create the database automatically:
- Start the WebLogic Server.
- Open a Web browser.
- Go to
http://localhost:7001/estore/index.html.
On Windows, the browser might open and point to the
correct URL automatically.
- Click Enter the Store. The server
will check whether your database tables are set up correctly. If
they are not, it gives you a link.
- Click the link to create the tables automatically.
Or use the
utils.Schema
database utility:
- Go to
weblogic\samples\petStore\src\petstore\src\docroot\WEB-INF\sql.
- Choose the SQL file that corresponds to your DBMS.
- Use the database utility
utils.Schema
to upload the data.
After you build the database, modify customer_ejb.xml:
- Open a text editor.
- With the text editor, open the customer_ejb.xml file:
cd petStoreHome\jps1.1.2\src\components\customer\src.
- In the customer_ejb.xml file,
search for
com.sun.j2ee.blueprints.customer.order.dao.OrderDAOCS.
- Change OrderDAOCS to OrderDAOOracle
for Oracle
or OrderDAOSybase for Sybase.
Step 13: Start the WebLogic Pet Store
- Open a new Web browser window.
- Go to http://localhost:7001/estore/index.html.
- Click Enter the Store.
Notes
The WebLogic Pet Store patch does the following:
- Updates deployment descriptors for WebLogic Server.
- Adds Ant build scripts.
- Fixes a bug in CatalogDAOImpl.java in Sun's Pet Store.
This bug fix allows you to run multiple Pet Store clients on one
WebLogic Server.
- Makes minor changes to JSP files to remove them from JSP compilation.
Any questions?
Please post to
j2ee-blueprints-interest
or the
weblogic.developer.interest.examples
newsgroup.