Generating adapter bindings using command line builds

Technote (troubleshooting)


Problem(Abstract)

If adapter binding classes are not generated using serviceDeploy, how do I generate them using command line builds?

Cause

In V7, WebSphere Integration Developer must be used to generate the adapter binding classes. When building and installing using serviceDeploy and appInstall commands on the server, if the generated classes do not already exist (as would be the default case if only the authored source was exported from WebSphere Integration Developer, or the source was extracted from version control), an error will occur during deployment to indicate that the adapter binding classes are missing.

Resolving the problem

To use WebSphere Integration Developer to build the project from the command line, complete the following steps:

  1. Build the adapter projects with WebSphere Integration Developer. This example builds a project called Test that has an EIS import and has a library called cicseci7201.

    a. Create an Ant script similar to the following Ant script:

    <project name="WID Build" basedir=".">
   <property name="module" value="Test"/>
   <property name="lib" value="cicseci7201"/>

   <target name="wid.importProject">
      <importProject projectName="${lib}"/>
      <importProject projectName="${module}"/>
   </target>
 
   <target name="wid.build" depends="wid.importProject">
      <projectBuild projectName="${lib}"/>
      <projectBuild projectName="${module}"/>
   </target>
</project>

b. Run the script using runAntWid.bat:
-In a command prompt, set the workspace environment variable. For example, set WORKSPACE=C:\Workspaces\AdapterBuildWorkspace or create your own batch file in place of runAntWid.
- Change to the <WID root>\bin directory (where runAntWid.bat is located), for example, cd C:\WID70\bin.
-Run the command runAntWid pointing to the above script with the target as a parameter, for example, runAntWid.bat -buildfile D:\AntScripts\BuildAdapterBindings.wid.xml wid.build.

The adapter projects are now built. The generated binding classes are in the gen/src folder. A .zip file that contains the projects can now be created and used as input to serviceDeploy in step 2.

2. Create a .zip file that contains the adapter projects and deploy them with WebSphere Process Server:

a. Create another Ant script similar to the following Ant script:

<project name="WPS Build" basedir=".">
    <taskdef name="wsStartApplication"
             classname="com.ibm.websphere.ant.tasks.StartApplication" />
    <taskdef name="wsInstallApp"
             classname="com.ibm.websphere.ant.tasks.InstallApplication" />
    <taskdef name="servicedeploy"
             classname="com.ibm.websphere.ant.tasks.ServiceDeployTask" /> 
    <property name="workspace.dir" value="C:/Workspaces/AdapterBuildWorkspace " />
    <property name="build.output.dir" value="C:/tmp/build/out" />
    <property name="build.working.dir" value="C:/tmp/build" />
    <property name="wps.home" value="C:/WID70_WTE/runtimes/bi_v7" />
    <property name="wps.username" value="admin" />
    <property name="wps.password" value="admin" />
    <property name="wps.node" value="qnode" />
    <property name="wps.server" value="server1" />
  
    <target name="wps.createPI">
        <zip basedir="${workspace.dir}"
             destfile="${build.output.dir}/${module}.zip"
             includes="${module}/**/**/*, ${lib}/**/**/*"
             excludes="**/CVS/**" />
    </target>

    <target name="wps.generateEAR" depends="wps.createPI">
        <servicedeploy scaModule="${build.output.dir}/${module}.zip"
                       workingDirectory="${build.working.dir}"
                       outputApplication="${build.output.dir}/${module}.ear"
                       wasHome="${wps.home}"
                       cleanStagingModules="true"
                       keep="true" />
    </target>
  
    <target name="wps.deploy" depends="wps.generateEAR">
 The app       <wsInstallApp ear="${build.output.dir}/${module}.ear"
                      user="${wps.username}"
                      password="${wps.password}"
                      failonerror="false" />
        <wsStartApplication application="${module}App"
                            server="${wps.server}"
                            node="${wps.node}"
                            user="${wps.username}"
                            password="${wps.password}" />
    </target>
</project>

b. Run the script.
- Change to the <WPS root>\bin directory, for example cd C:\WID70_WTE\runtimes\bi_v7\bin.
- Run the ws_ant command pointing to the script with the target as a parameter, for example, ws_ant.bat -f C:\AntScripts\BuildAdapterBindings.wps.xml wps.deploy

The Application Project application is installed. The generated binding classes are in the module utility jar.

For more information about command line builds using WebSphere Integration Developer and WebSphere Process Server, see Automating tests using Ant scripts.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere Integration Developer
Test and deployment tools

Software version:

7.0, 7.0.0.1, 7.0.0.2, 7.0.0.3, 7.0.0.4, 7.0.0.5

Operating system(s):

Linux, Windows

Reference #:

1614710

Modified date:

2012-10-29

Translate my page

Machine Translation

Content navigation