| Migration Tutorial Overview |
|
|
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:
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:Note: In the setMigrationEnv file, an entry in the CLASSPATH indicates where the sample data will reside: %WL_HOME%/eval/cloudscape/lib/cloudscape.jar.
Servlet files in: %WL51_HOME%\migrationserver\servletclasses
Server files in: %WL51_HOME%\migrationserver\serverclasses
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.EJBean in: %WL51_HOME%\migrationserver\app_banking.jar
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.
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 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
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
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.
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
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.
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
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.
To run the banking application:
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.
Use a Web browser to load the following URL:
http://localhost:7001/login.html
|
|
| Copyright © 2001 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher. |