Migration Tutorial Overview

prevnext

Deploying the Banking Application on WebLogic Server 5.1 SP 9 or Higher

 

Deploy the banking application on WebLogic Server 5.1 SP9 or higher by preparing the environment, the application, and the server. You will create directories, move files, and edit the following files included in the sample application package:

These scripts are provided in both DOS and Unix versions, .cmd and .sh, respectively.

Phases of the deployment of the banking application on WebLogic Server 5.1 are:

Build the Sample Application

Set up the application directories and run the build script:

1. Set up your development shell as described in Setting Up Your Environment. That is:

    1. Copy setMigrationEnv and startMigration from WL6x_HOME\samples\examples\tutorials\migration\banki ng to your WebLogic Server 5.1 directory.

    2. Edit the two copied files to reflect your WL51_HOME and JAVA_HOME locations

    3. Run setMigrationEnv.

      Note: In the setMigrationEnv file, an entry in the CLASSPATH indicates where the sample data will reside: %WL_HOME%/eval/cloudscape/lib/cloudscape.jar.

2. Create a directory in your WebLogic Server 5.1 directory--call it migrationserver--for the sample application.
3. In the migrationserver directory, create the following subdirectories:
\clientclasses\
\public_html\images\
\serverclasses\
\servletclasses\
4. Copy login.html and the .jsp files from the banking application's \html directory to the migrationserver\public_html subdirectory.
5. Copy BEA_Button_Final_web.gif from WL6X_HOME\config\examples\applications\examplesWebApp\images to WL51_HOME\migrationserver\public_html\images.
6. The sample application includes a build script for Windows NT: build.cmd.
This script builds the example application and places its files in the correct locations in your WebLogic Server 5.1 distribution, as follows:

	 Servlet files in: %WL51_HOME%\migrationserver\servletclasses 

	 	 Server files in: %WL51_HOME%\migrationserver\serverclasses 

	 	 EJBean in: %WL51_HOME%\migrationserver\app_banking.jar

Edit the build script, setting the WL51_HOME variable to your WebLogic Server 5.1 directory, and theJAVA_HOME variable to the JDK you wish to use.
7. In the WL6x_HOME\samples\examples\tutorials\migration\banking directory, run the build command.

Configure the Server

In this section, configure WebLogic Server 5.1 to run the sample application by changing the settings in the weblogic.properties file. For the banking example application, the settings in the weblogic.properties file should already be accurate as supplied, except for the JAVA_HOME and WL_HOME settings. The sections below describe the steps you would take to change the settings.

Set Up weblogic.properties

Copy the weblogic.properties file from the to the migrationserver directory.

Edit the JAVA_HOME and WL_HOME settings in the weblogic.properties file to the locations of your Java and WebLogic Server 5.1 directories, respectively.

Set the Database Persistence

Set the database persistence in the example banking application by uploading a file called banking.ddl whose SQL statements will be executed by the database.

Use the Schema utility to upload banking.ddl into the Cloudscape sample database by entering the following command from WL5.1_HOME\eval\cloudscape\data:

$ java -Dcloudscape.system.home=WL51_HOME\eval\cloudscape\data utils.Schema "jdbc:cloudscape:demo;create=true" COM.cloudscape.core.JDBCDriver -verbose WL6x_HOME\samples\examples\tutorials\migration\banking\banking.ddl

For information about using the Schema utility, see BEA WebLogic Server Administration Guide.

banking.ddl supplied with the example:

DROP TABLE ejbAccounts;

CREATE TABLE ejbAccounts (id varchar(15), bal float, type varchar(15));

insert into ejbAccounts values

   (6000, 35000.00,'savings');

insert into ejbAccounts values

   (1000, 1500.00,'checking');

Each instance of an EJBean is written to a row in a table (ejbAccounts), which must exist in the database before the example is run. The following line in weblogic.properties specifies the datasource:

weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.demoPool=demoPool

Set up a Connection Pool

In the weblogic.properties file, you uncomment the following lines to set up a working connection pool:

  # You can use this connection pool with any of the EJBean examples.

  # Uncomment to use:

  weblogic.jdbc.connectionPool.demoPool=\

         url=jdbc:cloudscape:demo,\

         driver=COM.cloudscape.core.JDBCDriver,\

         initialCapacity=1,\

         maxCapacity=2,\

         capacityIncrement=1,\

         props=user=none;password=none;server=none

Add Users to the User Pool Using an ACL

An access control list (ACL) for users of the pool has been added in the weblogic.properties file by the following line:

#Add an ACL for the connection pool:

weblogic.allow.reserve.weblogic.jdbc.connectionPool.demoPool=everyone

For more information about how to use connection pools, read Programming WebLogic JDBC: Overview of Connection Pools.

Deploy the AccountBean EJB

To deploy the AccountBean, specify the path to the app_banking.jar file in the line in weblogic.properties that begins weblogic.ejb.deploy.

weblogic.ejb.deploy=%WL51_HOME%/migrationserver/app_banking.jar

Register the Banking Servlet

The Banking Servlet has been registered by the following line in the weblogic.properties file:

weblogic.httpd.register.banking=examples.tutorials.migration.banking.BankAppServlet

For more information about registering servlets, see Setting WebLogic properties in the WebLogic Server Administration Guide.

Register RMILoggerImpl as a Startup Class

RMILoggerImpl has been registered as a startup class by the inclusion of the following line in the weblogic.properties:

weblogic.system.startupClass.rmilogger=examples.tutorials.migration.banking.RMILoggerImpl

Specify the Service Pack

setmigrationenv and startmigration both specify WebLogic Server 5.1 Service Pack 9. If you are using a later Service Pack, you will need to modify these scripts appropriately.

Run the Application

To run the banking application:

Start WebLogic Server 5.1

Start the migration server by running startmigration in the WL51_HOME directory.

You can check that the EJBean has been deployed correctly either by checking the server command line window, or by opening the Console and examining EJB under "Distributed objects"; you should see beanManaged.AccountHome deployed, and be able to monitor its activity.

For more information about starting the Weblogic Server 5.1 from the command line, see Setting up and Starting WebLogic Server 5.1.

Start the Banking Application

Use a Web browser to load the following URL:

 http://localhost:7001/login.html

Existing account numbers:

prevnext

 

Copyright © 2001 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.