Top
Interstage Studio User's Guide
FUJITSU Software

D.6.1 Migration from J2EE Container to Java EE Container

This section explains how to change a J2EE1.4 application intended for a J2EE container to one intended for a Java EE container.

Note

The following applications cannot be ported as applications intended for Java EE containers:

  • Web services (JAX-RPC)

  • Web service clients (JAX-RPC)

Web applications

Use the procedure below to enable operation in Java EE containers:

  1. Select properties from the project context menu.

  2. On the [Targeted Runtimes] page, select [Show all runtimes].

  3. Select Java EE runtime from the displayed runtimes, and then click [OK].

EJB applications

Migration processing for EJB applications that do not contain CMPs

Use the procedure below to enable EJB applications that do not contain CMPs to run in a Java EE container:

  1. Select properties from the project context menu.

  2. On the [Targeted Runtimes] page, select [Show all runtimes].

  3. Select Java EE runtime from the displayed runtimes, and then click [OK].

CMP2.0 migration processing

The following differences related to CMP2.0 apply to Java EE containers and J2EE containers:

Option

JavaEE Container

J2EE Container

Target runtime

JavaEE container

J2EE container

CMP extension information file

sun-cmp-mappings.xml

FJCMP_XXXX.xml

Database definition information

sun-ejb-jar.xml

FJCMP_XXXX.xml

Database table information

XXX.dbschema

None

Accordingly, new sun-cmp-mappings.xml, sun-ejb-jar.xml, and XXX.dbschema files must be generated to use CMP2.0 in Java EE containers. Use the [Update to CMP 2.0 Java EE environment] wizard to generate these files and change the target runtime. From [New] wizard, select [EJB] > [J2EE] > [Update to CMP 2.0 Java EE environment].

Check and enter the settings below.

Option

Description

Project selection

Select the project to be migrated.
The displayed projects are EJB projects that contain CMPs.

Use DB Schema

Specify whether or not to use database schemas.

Connection

A list of already created database connections is displayed. Select one of them.

Add connection

Opens the [New Connection Profile] wizard.

Connection

Connects to the database selected in the connection list box.

JNDI Name

Specify the JNDI name for the database connection used by the Java EE container.

After the above information is set, click [Next], set the items below and then click [Finish].

Option

Description

Project name

A selected project list is displayed.

EJB name

A list of CMPs included in the selected projects is displayed.

Table name

Information concerning the table that sets CMP relationships is displayed

Schema name

From the information concerning the database connected from the previous page, select the schema used by the table.
If relationships exist between CMPs, the information concerning all CMP schemas that have relationships can be changed.

Note

The wizard for updating to a CMP2.0 Java EE environment does not support CMP1.1 migration.
If CMP2.0 and CMP1.1 both exist in a project, migration processing is performed for CMP2.0 only, not for CMP1.1.
Refer to "CMP1.1 migration processing" for information on migrating CMP1.1.

CMP1.1 migration processing

The following tasks are required for CMP1.1 migration:

  1. Information migration from FJCMP_XXX.xml to sun-cmp-mapping.xml

    Code the information in FJCMP_XXX.xml in CMP1.1 to sun-cmp-mapping.xml.

    Item correspondences are shown below.

    sun-cmp-mappings.xml


    FJCMP_XXX.xml

    sun-cmp-mappings




    sun-cmp-mapping+




    schema


    fujitsu-cmp-definition/schema-name

    entity-mapping+

    <-

    fujitsu-cmp-definition


    ejb-name


    EJB name(ejb-jar.xml/ejb-name)

    table-name

    <-

    fujitsu-cmp-definition /table-name

    cmp-field-mapping+

    <-

    fujitsu-cmp-definition /field-map


    field-name

    <-

    fujitsu-cmp-definition /field-map/field-map-entry/field-name

    column-name+

    <-

    fujitsu-cmp-definition /field-map/field-map-entry/dbcolumn-name

    Refer to the Interstage Application Server manual for further details.

  2. Coding JDOQL queries to sun-ejb-jar.xml

    Since SQL query specifications are being changed, code the SQL query information to sun-ejb-jar.xml in JDOQL format.

    sun-ejb-jar.xml : <ejb>/<ejb-name>, <ejb>/<cmp>/<one-one-finders>/<finder>

    Code this item in the description format adopted for JDOQL, that is, <method-name>, <query-params>, <query-filter>, <query-ordering>.

    An example of finder method coding is shown below.

    <ejb>
        <ejb-name>TestCMP11</ejb-name>
        <jndi-name>jdbc/ORACLE</jndi-name>
        <cmp>
            <one-one-finders>
                <finder>
                    <method-name>testMethod</method-name>
                    <query-params>int param1</query-params>
                    <query-filter> id &lt; param1</query-filter>
                </finder>
            </one-one-finders>
        </cmp>
    </ejb>

    Refer to the Interstage Application Server manual for details.

  3. Generating database schema files

    Use the following command to generate database schema files:

    <Interstage Studio installation folder>\APS\F3FMisjee\bin\capture-schema.bat

    The following information must be specified when executing this command:

    Mandatory item

    Value

    database user name

    Database connection user name

    database user password

    Database password

    database connection destinations URL

    JDBC connection destination URL

    JDBC driver name

    Driver name of the JDBC driver to be used

    output file path

    {Workspace directory}/{project}/{source directory}/{sun-cmp-mappings/sun-cmp-mapping/schema}.dbschema

    name of schema to be used

    fujitsu-cmp-definition/schema-name

    name of table to be used

    fujitsu-cmp-definition/table-name

    Execute the command in the following format:

    capture-schema -username {database user name} -password {database user password}
     -dburl {database connection destination URL} -driver {JDBC driver name} -out {output file path}
    [-schemaname {name of schema to be used}] [-table {name of table to be used}]*

Ear applications

Use the procedure below to enable operation in Java EE containers:

  1. Select properties from the project context menu.

  2. On the [Targeted Runtime] page, select [Show all runtimes].

  3. Select Java EE runtime from the displayed runtimes, and then click [OK].