Version 1.0
This document explains how to use the Migration Tool for Sun Java System Application Server 8 (hereafter called the Migration Tool) to migrate the Titan_Business application from the BEA WebLogic Application Server 6.x source server to the Sun Java System Application Server 8 target server. The document also explains how to assemble, deploy, and run the sample application on the target server.
This document contains the following sections:
Overview
Prerequisites
Migrating the Application
Deploying and Running the Migrated Application on the Target Server
Titan_Business Overview briefly describes the Titan_Business sample application.
The following section describes what you need to do before you begin this exercise.
The following sections provide step-by-step instructions for setting up a database to use with the Titan_Business example:
This section describes how to migrate the application from the source server (BEA WebLogic Application Server 6.x) to the target server (Sun Java Systems Application Server 8).
On Solaris:
<ASMT_HOME>/bin> sh asmigrate.sh -u
On Windows:
<ASMT_HOME>\bin> asmigrate -u
Invoking the Migration Tool in Command-Line Mode explains how to run the Migration Tool in command-line mode.
The Migration Tool creates a directory structure that contains the migrated source files and generated build scripts in the output directory that you selected.
The build script generates the <OUTPUT_DIR>/titan_business/src/asmtbuild/cmr2.ear file, which you will deploy on the target server.
Before you begin these steps, make sure that the domain to which the application will be deployed is in the running state. These instructions assume that the application will be deployed to the default domain, domain1.
Use the asadmin utility in the Application Server 8 bin
directory to:
asadmin create-jdbc-connection-pool --user admin_user --password admin_password --host localhost --port 4848 --datasourceclassname dsclassname --property User=cmr:Password=cmr:URL_PROP=db_url CMRPool
Replace the variables shown in a blue font with values appropriate for your own environment.
dsclassname should be:
- oracle.jdbc.pool.OracleDataSource for Oracle
- com.pointbase.jdbc.jdbcDataSource for PointBase
URL_PROP should be:
- url for Oracle
- DatabaseName for PointBase
db_url should be:
- jdbc:oracle:thin:@ORACLE_HOST:1521:SID for Oracle, where ORACLE_HOST is the machine name/IP address on which the database is installed, and SID is the System ID of the Oracle database.
- jdbc:pointbase:server://POINTBASE_HOST:9092/migration-samples for Pointbase, where POINTBASE_HOST is the machine name/IP address on which the database is installed. This will be localhost in most cases.
Note: You must escape all of the ":" characters in the URLs listed above with a double backslash ("\\") on Solaris and a single backslash ("\") on Windows to avoid errors while running the create-jdbc-connection-pool command.
asadmin create-jdbc-resource --user admin_user --password admin_password --host localhost --port 4848 --connectionpoolid CMRPool jdbc/cmr
Replace the variables shown in a blue font with values appropriate for your own environment.
asadmin create-persistence-resource --user admin_user --password admin_password --host localhost --port 4848 --connectionpoolid jdo/pmfPM --factoryclass com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl jdo/pmf
Replace the variables shown in a blue font with values appropriate for your own environment.
asadmin create-jdbc-resource --user admin_user --password admin_password --host localhost --port 4848 --connectionpoolid CMRPool jdo/pmfPM
Replace the variables shown in a blue font with values appropriate for your own environment.
Note: Complete this step only if you are using the Oracle database. The driver class for PointBase is already in the server classpath.
asadmin get --user admin_user --password admin_password --host localhost --port 4848 server.java-config.classpath_prefix
Replace the variables shown in a blue font with values appropriate for your own environment.
Write down the prefix. For this example, assume that the classpath prefix is CLASSPATH.
asadmin set --user admin_user
--password admin_password
--host localhost
--port 4848
server.java-config.classpath_prefix=CLASSPATH${path.separator}PATH_TO_DRIVER_CLASSES
Replace the variables shown in a blue font with values appropriate for your own environment.
The PATH_TO_DRIVER_CLASSES variable points to the location of classes12.zip, the driver classes for the Oracle database.
Note: See the Preparing the Sun Java Systems Application Server 8 to Run the Migrated Applications section for additional information.
asadmin stop-domain asadmin start-domain
asadmin deploy --user admin_user --password admin_password --host localhost --port 4848 <OUTPUT_DIR>/titan_business/src/asmtbuild/cmr2.ear
Replace the variables shown in a blue font with values appropriate for your own environment.
http://localhost:<port>/customer
Each of these JSPs shows a particular type of CMR. The JSPs that you did not invoke are helpers, which show no meaningful output of their own.
After you invoke a JSP, press the "Delete All Rows of All Tables" button at the bottom of each JSP display to empty the database tables before you reinvoke the JSP. If you do not, an error will occur.