BEA Logo BEA WebLogic Server Release 6.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

   

Run 2002 J2EE Deployathon Online! With BEA WebLogic ServerTM

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:

  1. Download Version 6.1 from http://commerce.bea.com.
  2. Register as a BEA WebLogic Developer, if you haven't already.
  3. The directory in which you install the WebLogic Server is your WebLogic home (called here weblogic).
  4. Quick Install: Click the executable file and move through the Installer steps.
  5. Or, use the more complete instructions at http://download.oracle.com/docs/cd/E13222_01/wls/docs61/install/index.html.
  6. During installation, choose a password. Remember it.

 

Step 3: Download the Java Pet Store from Sun Microsystems

  1. Download the Java Pet Store from the Sun Java Developer Connection.
  2. Register for the Java Developer Connection, or if you are already registered, enter your name and password.
  3. Download Version 1.1.2 of the Java Pet Store. The download file is named jps-1_1_2.zip.
  4. Create a directory for the Pet Store outside of your WebLogic home directory.
  5. 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

  1. Download the WebLogic Pet Store patch for Windows or Unix.
  2. Unzip it to petStoreHome, the directory above the Pet Store files (the Pet Store files are in petStoreHome\jps1.1.2).
  3. If you zip utility asks you to confirm overwriting files, click Yes or Yes to All.
  4. 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

  1. Open a command window.
  2. Move to the WebLogic examples domain: cd weblogic\config\examples
  3. 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.
  4. 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

  1. In your development environment window, move to the Pet Store source directory:
    cd petStoreHome\jps1.1.2\src\petstore\src
  2. Run the build script installed by the patch:
    • On Windows: build
    • On UNIX Bourne shell: sh build.sh
  3. Move to the build directory: cd ..\build
  4. Look for the file petstore.ear

 

Step 7: Copy the EAR file to the WebLogic Home Directory

  1. 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

  1. Move to the examples domain in your WebLogic home directory: cd weblogic\config\examples
  2. Use a script to start the server:
    • On Windows - startExamplesServer
    • On UNIX Bourne shell: sh startExamplesServer.sh
  3. When prompted, enter the password you chose when you installed the WebLogic Server.

 

Step 9: Open the WebLogic Administration Console

  1. Open a Web browser.
  2. 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.
  3. 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

  1. In the left pane, expand Services > JDBC.
  2. Click Connection Pools.
  3. In the right pane, click Configure a New JDBC Connection Pool.
  4. 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.
  5. Click Create.
  6. Click the Targets tab.
  7. Move examplesServer to the Chosen (right) column.
  8. Click Apply.

 

Step 11: Create Three New JDBC Data Sources

For the first data source:

  1. Click the Home icon in the upper right of the Administration Console.
  2. In the left pane, expand Services > JDBC..
  3. Click Data Sources.
  4. In the right pane, click Configure a New JDBC Data Source.
  5. For Name, enter EstoreDB.
  6. For JNDI Name, enter jdbc.EstoreDB.
  7. For Pool Name, enter petstorePool.
  8. Click Create.
  9. Click the Targets tab.
  10. Move examplesServer to the Chosen (right) column.
  11. Click Apply.
  12. To check the current list of data sources, click Home, then JDBC > Data Sources.

For the second data source:

  1. For Name, enter InventoryDB.
  2. For JNDI Name, enter jdbc.InventoryDB.
  3. For Pool Name, enter petstorePool.
  4. Click Create.
  5. Click the Targets tab.
  6. Move examplesServer to the Chosen (right) column.
  7. Click Apply.

For the third data source:

  1. For Name, enter SignOnDB.
  2. For JNDI Name, enter jdbc.SignOnDB.
  3. For Pool Name, enter petstorePool.
  4. Click Create.
  5. Click the Targets tab.
  6. Move examplesServer to the Chosen (right) column.
  7. 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:

  1. Start the WebLogic Server.
  2. Open a Web browser.
  3. Go to http://localhost:7001/estore/index.html. On Windows, the browser might open and point to the correct URL automatically.
  4. 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.
  5. Click the link to create the tables automatically.

Or use the utils.Schema database utility:

  1. Go to weblogic\samples\petStore\src\petstore\src\docroot\WEB-INF\sql.
  2. Choose the SQL file that corresponds to your DBMS.
  3. Use the database utility utils.Schema to upload the data.
After you build the database, modify customer_ejb.xml:
  1. Open a text editor.
  2. With the text editor, open the customer_ejb.xml file: cd petStoreHome\jps1.1.2\src\components\customer\src.
  3. In the customer_ejb.xml file, search for com.sun.j2ee.blueprints.customer.order.dao.OrderDAOCS.
  4. Change OrderDAOCS to OrderDAOOracle for Oracle or OrderDAOSybase for Sybase.

 

Step 13: Start the WebLogic Pet Store

  1. Open a new Web browser window.
  2. Go to http://localhost:7001/estore/index.html.
  3. 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.

 

 

 
Copyright © 2002 BEA Systems, Inc. All rights reserved. 


Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.