Migrating the JCA Application from the J2EE Reference Implementation Application Server 1.3 to Sun Java System Application Server 8

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 Survey application from the J2EE Reference Implementation 1.3 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
Migrating the Application
Deploying and Running the Migrated Application on the Target Server

Overview

JCA Overview describes the JCA sample application.


Migrating the Application

This section describes how to migrate the application from the source server (J2EE Reference Implementation 1.3) to the target server (Sun Java Systems Application Server 8).

  1. Set the following environment variables that are used by the Migration Tool's build scripts:


  2. Start the Migration Tool in GUI mode:
  3. 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.

  4. Specify the Source Application (Input) details:

    1. Select "Archive" and specify the file <ASMT_HOME>/examples/j2ee_ri_1_3/JCA/connector-ic.rar as input to the Migration Tool.

    2. Select the Source Server as J2EE Reference Implementation Application Server 1.3 from the dropdown list.

  5. Specify the Target Application (Output) details:

    1. Specify a Directory path of your choice to the location where the migrated output application should be written. From here on, this document will refer to this directory path as <OUTPUT_DIR1>.

    2. Select the Target Server from the dropdown list. Your only choice is Sun Java Systems Application Server 8.

  6. Press the Migrate button.

    The Migration Tool creates a directory structure that contains the expanded archive, modified files, and generated build scripts in the output directory that you selected.


  7. J2EE RI 1.3 does not have a server-specific deployment descriptor (DD) file, in which the JNDI name and other server-specific information is stored, for resource adapters. Instead, this information is stored in the server-specific configuration files.

    Open the sun-ra.xml file, which the Migration Tool generates in the <OUTPUT_DIR1>/Input_Archives/Rars/connector-ic/META-INF directory, in a text editor and change the following value:

      <sun-connector>
          <resource-adapter jndi-name="REPLACEME" . . . >
          </resource-adapter>
             .
             .
      </sun-connector>

    to:

      <sun-connector>
          <resource-adapter jndi-name="eis/Comet" . . . >
          </resource-adapter>
             .
             .
      </sun-connector>

    This JNDI name was specified when the resource adapter was originally deployed on the source server to bind the JNDI name for the Connection Factory to the RAR file.

  8. Change to the <OUTPUT_DIR1>/Input_Archives/Rars/connector-ic directory and run the appropriate build script to generate the Rar1.rar file:

    The build script generates the <OUTPUT_DIR1>/Input_Archives/Rars/connector-ic/asmtbuild/Rar1.rar file.

  9. Go back to the Migration Tool GUI and specify the Source Application (Input) details:

    1. Leave "Archive" selected and specify the file <ASMT_HOME>/examples/j2ee_ri_1_3/JCA/JCATEST.ear as input to the Migration Tool.

    2. Leave the Source Server selection as J2EE Reference Implementation Application Server 1.3.

  10. Specify the Target Application (Output) details:

    1. Specify a Directory path of your choice to the location where the migrated output application should be written. This location should be different from the directory location that you previously entered. From here on, this document will refer to this directory path as <OUTPUT_DIR2>.

    2. Select the Target Server from the dropdown list. Your only choice is Sun Java Systems Application Server 8.

  11. Press the Migrate button.

    The Migration Tool creates a directory structure that contains the expanded archive, modified files, and generated build scripts in the output directory that you selected.


  12. Change to the <OUTPUT_DIR2>/Input_Archives directory and run the appropriate build script to generate the JCATEST.ear file:

    The build script generates the <OUTPUT_DIR2>/Input_Archives/asmtbuild/JCATEST.ear file.


Deploying and Running the Migrated Application on the Target Server

  1. Make sure that you have set the environment variables.

  2. Add the backend.jar file to the JVM settings of the Application Server:
    asadmin set --user <username> --password <password> 
      server-config.java-config.classpath_suffix=<ASMT_HOME>/examples/j2ee_ri_1_3/JCA/backend.jar
  3. Start the Application Server.

  4. Deploy the Rar1.rar and JCATEST.ear files.

    1. Change to the bin directory in the Application Server and run the following asadmin commands:
      asadmin deploy --user username --password password 
        --host hostname --port adminport 
        <OUT_DIR1>/Input_Archives/Rars/connector-ic/asmtbuild/Rar1.rar
      
      asadmin deploy --user username --password password 
        --host hostname --port adminport --type application
        <OUT_DIR2>/Input_Archives/asmtbuild/JCATEST.ear
    2. Run the application:

      1. Run the following command at the command prompt:

        % java -classpath <pathtobackend.jar>/backend.jar Server 8020
      2. Access the deployed application by browsing to the following URL:
          http://<machine_ip>:<port>/CometEJB/startForm.jsp

    Index
    Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved.