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 iBank application from the BEA WebLogic Application Server 5.1 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
iBank Overview briefly describes the iBank 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 iBank example:
This section describes how to migrate the application from the source server (BEA WebLogic Application Server 5.1) 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.
If you select these options, the migration tool will upgrade all CMP beans, in this particular case, to EJB 2.0 version of specifications. For more information about the ramifications of selecting these options, see the sections of the tool's online help that are associated with each of these options.
Depending on the options you selected during the migration process, the following files may show up in the "Files that failed to Migrate" section of the migration report:
This file fails only if you selected the Migrate CMPs from EJB 1.1 to 2.0 specs option under the Advanced options.
Reason of Failure:
If the migration tool finds that, in a particular CMP entity bean, there is a finder method in the home interface which has a java.util.Enumeration as return type, it will fail to upgrade this bean to EJB 2.0 specification, because such an upgrade would violate the specification.
Remedial Action:
The bean that fails the migration can still be modified by the migration tool to make it deployable on Application Server 8. However, if the EJB 2.0 upgrade is required, you must change the return type of the finder method and modify the client code wherever this method is being called.
This file will fail irrespective of the Advanced options you select.
The init() method of this servlet contains a call to System.setErr(PrintStream err). This method is cannot be called by an application according to the default Application Server 8 security policy. The migration tool detects calls to such method calls and flags such files as failed in the migration report.
Remedial Action:
Take one of the following remedial actions:
The Migration Tool creates a directory structure that contains the migrated source files and generated build scripts in the output directory that you selected.
If you created your own mySchema.dbschema file, copy it to the <OUTPUT_DIR>/iBank/entity/ directory.
The build script generates the <OUTPUT_DIR>/iBank/src/asmtbuild/ibank.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=ibank_user:Password=ibank_user:URL_PROP=db_url TMB
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 --jdbcjndiname TMB jdbc/IBank
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 TMB --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.
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>/iBank/src/asmtbuild/ibank.ear
Replace the variables shown in a blue font with values appropriate for your own environment.
grant codeBase "file:${com.sun.aas.installRoot}
/domains/domain1/applications/j2ee-apps/ibank_1/-" {
permission java.lang.RuntimePermission "setIO";
};Save the server.policy file and restart the server so the revised policy file takes effect.
See the postrun section of the user's guide for additional information about the security policy of Application Server 8.
http://localhost:<port>/ibank