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 Developer.

To run the J2C migration tool from a command line:
  1. Change to the directory where the J2CMigration.bat and J2CMigration.sh files are located:
    • : the default installation directory for the J2C migration tool is system_drive:\Program Files\IBM\Rational\Software Development Platform\6.0\rad\eclipse\plugins\com.ibm.j2c.migration_6.0.1.
    • : the default installation directory for the J2C migration tool is /opt/IBM/Rational/SoftwareDevelopmentPlatform/6.0/rad/eclipse/plugins/com.ibm.j2c.migration_6.0.1.
  2. You need to modify the J2CMigration.bat or J2CMigration.sh
    1. Locate the place in the file where you Set the classpath for the tool, which allows you to set eclipse root and workspace:

      @REM set eclipse root and workspace
      @REM=============================================================
      :OK
      if .%ECLIPSE_ROOT%.==.. SET ECLIPSE_ROOT=d:\Rational\SDP\6.0\eclipse
      if .%WORKSPACE%.==.. SET WORKSPACE=%ECLIPSE_ROOT%\workspace

      	if [ "$ECLIPSE_ROOT" = "" ]
      	then
      		ECLIPSE_ROOT="/opt/IBM/Rational/SDP/6.0/eclipse"
      	fi
      
      	if [ "$WORKSPACE" = "" ]
      	then
      		WORKSPACE="/root/IBM/rationalsdp6.0/workspace"
      	fi
      Replace the current ECLIPSE_ROOT and WORKSPACE with your own values.
    2. Locate the place in the file where you set eclipse root and workspace for options file migration processingset eclipse root and workspace for options file migration processingSET ECLIPSE_ROOT= is located.

      :setenv
      if .%ECLIPSE_ROOT%.==.. SET ECLIPSE_ROOT=d:\Rational\SDP\6.0\eclipse
      if .%WORKSPACE%.==.. SET WORKSPACE=%ECLIPSE_ROOT%\workspace

      ???
      Replace the current ECLIPSE_ROOT and WORKSPACE with your own values.
  3. Save and close the file. From the J2CMigration directory in your product install folder, run the J2CMigration.bat or 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.txtSample Migration Inputfile Sample Migration Inputfilefor 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 ECHO 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.
    -migrationinputfile    

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:\SampleMigratiom.txt"

./J2CMigration.sh -f /home/SampleMigratiom.txt"

Migrate according to the options being specified in the Sample Migration Inputfile

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.