Migrating J2C programs using the command line

You can use the command line to migrate programs from WebSphere® Studio Application Developer Integration Edition into Rational® application tools.

Procedure

  1. Change to the directory where the J2CMigration.bat and J2CMigration.sh files are located:
    • windows icon the default installation directory for the J2C migration tool is system_drive: <install-dir>\plugins\com.ibm.j2c.migration.wsadie_7.2.0.vxxx.
    • linux icon: the default installation directory for the J2C migration tool is: <install-dir>\plugins\com.ibm.j2c.migration.wsadie_7.2.0.vxxx.
  2. You need to modify the J2CMigration.bat or J2CMigration.sh
    1. Locate the place in the file where you set variables:
      ECLIPSE_ROOT: This is where the eclipse.exe and eclipse.ini files are located. The default value will be <install-dir> for Rational application development products.
      • windows icon ECLIPSE_ROOT= <install-dir> , where you will set the directory location to match your environment.
      • linux icon SET ECLIPSE_ROOT=/opt/<install-dir>
      JDK_HOME : This is where the java.exe is located.
      • windows icon The default path is %ECLIPSE_ROOT%\jdk\jre\bin
      • linux icon SET JDK_HOME=%ECLIPSE_ROOT%/jdk/jre/bin
      .
       rarsPathVar : This is the path where the Resource Adapters folder is located. You can locate the exact path by opening <install_path>configuration/config.ini, and searching for rarsPathVar.
      • windows icon SET RARVARPATH=%ECLIPSE_ROOT%/ResourceAdapters.
      • linux icon SET RARVARPATH=%ECLIPSE_ROOT%/ResourceAdapters
      was.runtime: This is where the WAS runtime folder is located. You can locate the exact path by opening <install_path>configuration/config.ini, and searching for rarsPathVar.
      • windows icon SET WASRUNTIME=%ECLIPSE_ROOT%/runtimes
      • linux iconSET WASRUNTIME=%ECLIPSE_ROOT%/runtimes
      EQUINOXJAR: This is where the org.eclipse.core.Launcher.Main jar file is located.
      • windows icon SET EQUINOXJAR=%ECLIPSE_ROOT%\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar
      • linux iconSET EQUINOXJAR=%ECLIPSE_ROOT%/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar
      • The default workspace %WORKSPACE% %WORKSPACE%will be set to: %WORKSPACE%%ECLIPSE_ROOT%\workspace\Migration1 or %ECLIPSE_ROOT%\workspace\Migration1 in the migration batch file or shell script.
  3. Save and close the file. From the J2CMigration directory in your product install folder, run the J2CMigration.bat and J2CMigration.sh.
  4. Enter the appropriate command and option as described in the tables below:
    Table 1. Commands to run the J2C Migration Tool
    Windows command Linux command Description
    J2CMigration.bat [options] ./J2CMigration.sh [options] Use this command for starting the J2C Migration tool, using one of the two usage patterns:
    Usage:
    • J2CMigration.bat -w wsdlsource -d workspace [-p project] [-t type] [-o option] [-s summary]
    • J2CMigration.bat -f migrationinputfile
    J2CMigration [options]   Options
    • -w wsdlsource: The full path of the service WSDL file or the full path of the folder that contains one or more service WSDL files.
    • -f migrationinputfile: The migration file which contains the above options to be passed into the command line migration tool This method is useful when your command line options exceed the maximum allowable length. See SampleMigration.txt Sample Migration Inputfile for reference.
    • -d workspace: The workspace where the output is generated.
    • [-p project] : The name of the project where the migrated artifacts will be generated. Do not include a path, just a name for the project. You can specify web, Java™, or EJB project to be created. If no project is specified, a default Java project will be created. If you do not specify the -p option, then the migrated artifacts will be generated to the project specified in the service WSDL file.
    • [-t type]: Project type of the output project:
      • WEB
      • EJB
      • JAVA
    • [-o option]
      • databindingonly: Specify this option if you want only data binding beans to be generated during migration. If you specify databindingonly, the commandbean option will be ignored.
      • commandbean: Specify this option if you want a command bean to be generated.
    • [-s summary]: The name of migration summary (without .xml). If none is specified, the default summary file will be j2cmigration_timestamp.xml. If the summary file already exists, we will write the summary to the summary_timestamp.xml. If you specify a location say d:\summaryFolder\summary, the summaryFolder must exist. If you do not specify a location, the summary will be generated in the current directory.
    • [cicsver]: The version of the CICs rar you are using in your migrated project. For example, 6.1.0.2. If no CICs resource adapter version is specified, the application locates one from the registry.
    • [imsver]: The version of the IMS™ rar you are using in your migrated project. For example, 9.1.0.2.5a. If no IMS resource adapter version is specified, the application locates one from the registry.
    • [wasver]: The version of the WebSphere application server you are using in your migrated project. If none specified, the default is 7.0 Valid values:
      • was.base.v61
      • was.base.v7
    • [cicsrar]: The full path to the CICs resource adapter. For example: d:\IBM\sdp75\ResourceAdapters\cicseci6102.rar.
    • [imsrar]: The full path to the IMS resource adapter. For example: d:\IBM\sdp75\ResourceAdapters\imsico91025.rar.
    • [suffix]: impl, proxy, or any suffix that you want to use for your J2C implementation. If this option is not specified, the implementation suffix is proxy.

Example

Command-line migration examples

J2CMigration.bat -d "d:\myworkspace" -w "d:\mywsdl.wsdl" -p "OutputProject"
./J2CMigration.sh -d /home/myworkspace -w /home/mywsdl.wsdl -p OutputProject
This command line will migrate a single service as defined in d:\myservicewsd.wsdl. The migrated artifacts are generated in a Java project with the project name "OutputProject" inside workspace d:\myworkspace. The files generated are
  • interface Java file
  • proxy(implementaion) Java file
  • data binding Java file
  • j2cmigration_timestamp.xml file (The migration summary will be saved in under current directory.
J2CMigration.bat  -w "d:\mywsdlFolder" -p "OutputProject" -s "MigrationReport"
./J2CMigration.sh -w /home/mywsdlFolder -p OutputProject -s /home/myworkspce/MigrationReport

This will migrate all the services in the folder d:\myservicewsdlfolder or in any other subfolders under d:\myservicewsdlfolder. The migrated artifacts (for all the services) are generated in a single Java project with the project name "OutputProject" . The files generated are

J2CMigration.bat -w "d:\myfolder" -o databindingonly
./J2CMigration.sh -w /home/myfolder -o databindingonly

This will migrate all the services in the folder d:\myfolder or in any other subfolders under d:\myfolder. The files generated are:

J2CMigration.bat -w "d:\myfolder" -o commandbean -t EJB
./J2CMigration.sh -w /home/myfolder -o commandbean -t EJB

This will migrate all the services in the folder d:\myfolder or in any other subfolders under d:\myfolder. The migrated artifacts are generated in EJB Projects with the project names take from the WSDL definitions. . The files and artifacts generated are:

J2CMigration.bat -f "d:\SampleMigration.txt"
./J2CMigration.sh  -f /home/SampleMigration.txt"

Migrate according to the options being specified in the migration inputfile.


Feedback