Chapter 6. Migrating from BEA WebLogic 153
Figure 6-7 JUnitEE test page for xPetstore EJB
6.5.3 Migrating the sample application
In this section, we describe the steps we performed to migrate xPetstore EJB.
This migration effort should be straightforward since xPetstore EJB was
developed following best-practices and J2EE standards.
Importing the application EAR file
Start the migration by importing to Rational Application Developer V6 the EAR
file that was built for and deployed to BEA WebLogic Server 8.1.
To import the EAR file start Rational Application Developer V6 and open the
Resource perspective.
1. Right-click in the Navigator view and choose Import from the context menu.
You should see the Import dialog as illustrated in Figure 6-8 on page 154.
Note: We used a new Rational Application Developer V6 workspace for the
migration. The workspace folder will be referred to as <rad_workspace>.
154 Migrating Applications from WebLogic, JBoss and Tomcat to WebSphere V6
Figure 6-8 Import EAR dialog in Rational Application Developer V6
2. Select the EAR file option from the list and click Next. On the next page,
specify the EAR file built for BEA WebLogic Server 8.1 located in the
following directory:
3. Click Finish. It may take a few minutes to finish the import of the project and
automatically perform all necessary configuration and validation actions.
The wizard automatically created four new projects in your workspace as
illustrated in Figure 6-9 on page 155.
Chapter 6. Migrating from BEA WebLogic 155
Figure 6-9 Navigator view in Rational Application Developer V6 after importing EAR file
The first item in the navigator view is the EAR project. The second item contains
the EJB project and the third item the Web application project. The last item is
the test project which contains unit tests.
Creating a new back end
When you first import the EAR file into Rational Application Developer V6, the
project is configured to use Cloudscape as the back end database. Our initial
and destination environments use DB2 Universal Database V8.2. In the source
environment, the database schema was created by BEA WebLogic Server 8.1.
We will use the same database but create a new schema designed for
WebSphere Application Server V6.
There are three options available in Rational Application Developer V6 for
mapping CMPs to a database.
򐂰 Bottom-up
This option generates EJBs and the mapping from an existing database.
򐂰 Top-down
Generates a database schema and map from existing EJBs.
򐂰 Meet-in-the-middle
Generates the mapping between an existing database and existing EJBs.
Tip: Before proceeding, it is recommended that you configure Rational
Application Developer V6 to not to build the projects automatically after
changes to the source. This is done by deselecting the Build Automatically
option in the Project menu.
156 Migrating Applications from WebLogic, JBoss and Tomcat to WebSphere V6
Next, we describe how to generate a new database schema for xPetstore EJB by
using the top-down approach:
1. Still in the Navigator view in the Resource perspective in Rational Application
Developer V6. Right-click the xpetstore-ejb_EJB project.
2. Select EJB to RDB Mapping Generate Map from the context menu.
3. Choose Create a new backend folder and click Next.
4. Select Top-Down from the list of options and click Next.
5. Specify the following values on the next page:
Table 6-30 Database configuration for wizard
6. Leave the remaining options by default and click Finish. You should be able
to see the same folder structure in the Navigator view as illustrated in
Figure 6-10 on page 157.
Note: We used the same database as BEA WebLogic Server 8.1 but will
create a new schema that will be used by WebSphere Application Server.
We did not use the database schema generated by BEA WebLogic Server
8.1, since the generation of the CMP mapping files using the
Meet-in-the-middle approach did not work.
This is because the table and column names do not match the CMPs. In
Chapter 7, “Migrating from JBoss” on page 175, we describe how to use the
meet-in-the-middle approach in more detail.
In a real world migration project, the existing database would most likely be
used without modifications. For that scenario, use the Meet-in-the-middle
Parameter Value
Target database
DB2 Universal Database Express
Database name wl_xp_ej
Schema name NULLID

Get Migrating Applications from WebLogic, JBoss and Tomcat to WebSphere V6 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.