Creating the EAR files

The following procedure describes how to create your own version of the Java(TM) Client Sample Application EAR file using the application source code and the prerequisite functional units available in the Branch Transformation Toolkit installation directory. If you complete this procedure, the resulting environment in your WebSphere(R) Studio Application Developer Integration Edition workspace is the same as the workspace you get when you import the BTTJavaSample.ear file. This enables you to make changes to the Java Client Sample Application and then generate your own deployable application.

To create the EAR files for the Java Client Sample application:

  1. Change the Java preferences:
    1. In your WebSphere Studio Application Developer Integration Edition, select Window > Preferences.
    2. Under Java > New Project, select Use Folders as the source and output location.
  2. Create a Java project :
    1. Open the Java perspective.
    2. Create a Java project named BTTJavaSampleUserDefinedClass.
    3. Select the BTTJavaSampleUserDefinedClass/src directory and import the source files (.java files) from the BTTJavaSampleUserDefinedClass.zip file in the <toolkit root>\samples\JavaClientSampleApplication\source directory.
      Note: <toolkit root> refers to the root directory of your Branch Transformation Toolkit installation folder.
    4. Add the <toolkit root>\jars\bttbase.jar as an external JAR to the Java Build Path of this new Java project.
  3. Create a J2EE Enterprise Application project with a Web, an EJB, and a Client module:
    1. Open the J2EE perspective.
    2. Create a J2EE Enterprise Application project with the following settings:
      • Create a J2EE 1.3 Enterprise Application project.
      • Set the Enterprise application project name to BTTJavaSample.
    3. Select the Enterprise Application directory and import the following JAR files from the <toolkit root>\jars:
      • bttbase.jar
      • bttfmt.jar
      • bttjdbjsvc.jar
      • bttjdbtsvc.jar
      • bttsvcinfra.jar
      • bttsvrbean.jar
      • dseb.jar
      • dsed.jar
      • dseflp.jar
      • dsesym.jar
      • dsegb.jar
      • dsetde.jar
      • dsecss.jar
      • dsecsm.jar
      • dsehcon.jar
      • sn0dummy.jar
      Note: You should add the .properties files from properties/serviceproperties/ and sampleapplserver.properties in the <toolkit root>\Samples\BTTJavaSample\source\BTTJavaSampleWeb.zip file to bttsvcinfra.jar/ before you add it as an external JAR.
    4. Browse to BTTJavaSample\META-INF and edit the application.xml file to add the BTTJavaSampleUserDefinedClass project as a Project Utility JARs.
  4. Configure the EJB module:
    1. Select the BTTJavaSampleEJB/ejbModule directory and import all the files and directory structure from the BTTJavaSampleEJB.zip file located in the <toolkit root>\samples\JavaClientSampleApplication\source directory.
    2. Browse to BTTJavaSampleEJB/ejbModule/META-INF and edit the manifest.mf file:

      In the dependencies list, select the following JAR files:

      • BTTJavaSampleUserDefinedClass.jar
      • bttbase.jar (Base components for new feather of BTT5.0 )
      • bttfmt.jar (CHA Formatter Services)
      • bttjdbjsvc.jar (JDBC Journal Service)
      • bttjdbtsvc.jar (JDBC Table Service)
      • bttsvcinfra.jar (Services Infrastructure))
      • bttsvrbean.jar (Single Action EJB)
      • sn0dummy.jar (Dummy sna)
    3. Right click BTTJavaSampleEJB, select Generate\Deploy and Rmic Code... , then click Select all and finish.
  5. Configure the Web module:
    1. Select the BTTJavaSampleWeb/Web Content/WEB-INF/lib directory and import the following JAR files from the <toolkit root>\jars directory:
      • dseb (Base components)
      • dsecsm (Client/Server Mechanism)
      • dsecss (Client/Server Support)
      • dseflp (Flow Processor)
      • dseflpe (Flow Processor Extensions)
      • dsehcon (HTML Connector)
      • dsejcon (Java Connector)
      • dsejspb (JspBeans)
      • dsepsi (Presentation Server Infrastructure)
      • dsesym (System Management)
      • dsetde (Typed Data Extensions)
      • bttbase.jar
      • bttinvoker (Invoker)
      Note: You should replace BeanInvokerRegistryMapper.properties located in com/ibm/btt/cs/invoker/base of bttinvoker.jar/ with the same name file from properties/invokeproperties/ in BTTJavaSampleWeb.zip file in the <toolkit root>\Samples\JavaClientSampleApplication\source directory.
    2. Import the BTTJavaSample Application resource files into the Web module:
      1. Select the BTTJavaSampleWeb/Java Source directory and import the source files (.properties and .java files) from the BTTJavaSampleWeb.zip file in the<toolkit root>\samples\JavaClientSampleApplication\source directory .
      2. Select the BTTJavaSampleWeb/Web Content directory and import the Web files (JSP and HTML files) from the root of the BTTJavaSampleWeb.zip file located in the <toolkit root>\samples\JavaClientSampleApplication\source directory. Make sure that you do not retain the \war.html directory structure in the destination directory.
      3. Add a \jars directory to the BTTJavaSampleWeb/Web Content directory. Import the following JAR files from the <toolkit root>\jars directory:
        • dseb.jar
        • dsed.jar
        • dseflp.jar
        • dsesym.jar
        • dsegb.jar
        • dsetde.jar
        • dsecss.jar
        • dsecsm.jar
        • dsehcon.jar
      4. Select the BTTJavaSampleWeb\Web Content directory and import the \dse directory from the root of BTTJavaSampleWeb.zip file in the <toolkit root>\samples\JavaClientSampleApplication\source directory.
      5. Creat a new package named com.ibm.btt.samples.appl.business in BTTJavaSampleWeb/Java Source and copy the following .java files from BTTJavaSampleEJB/ejbModule and BTT_SampleBusinessProcessEJB/ejbModule to the new package:
        • AccountStatement.java
        • AccountStatementHome.java
        • CustomerSearch.java
        • CustomerSearchHome.java
        • DepositProcessService.java
        • DepositProcessServiceHome.java
        • EndSessionAction.java
        • EndSessionActionHome.java
        • StartupHtmlSessionAction.java
        • StartupHtmlSessionActionHome.java
        • StartupJavaSessionAction.java
        • StartupJavaSessionActionHome.java
        • StartupServerAction.java
        • StartupServerActionHome.java
        • WithdrawalProcessService.java
        • WithdrawalProcessServiceHome.java
  6. Configure the client module:
    1. Select the BTTJavaSampleClient/ApplClientModule directory and import the source files (.properties and .java files) from the BTTJavaSampleClient.zip file located in the <toolkit root>\samples\JavaClientSampleApplication\source directory.
    2. Select the BTTJavaSampleClient/ApplClientModule directory and import the images directory from the BTTJavaSampleClient.zip file located in <toolkit root>\samples\JavaClientSampleApplication\source directory into the BTTJavaSampleClient/applClientModule directory.
    3. Select the Enterprise Application directory and import the following JAR files from the <toolkit root>\jars directory:
      • dseb.jar
      • dsed.jar
      • dseflp.jar
      • dsesym.jar
      • dsegb.jar
      • dsetde.jar
      • dsecss.jar
      • dsecsm.jar
      • dsehcon.jar
    4. Browse to BTTJavaSampleClient/ApplClientModule/META-INF and edit the manifest.mf file so that it refers to the required JAR files in the application client module:
      1. In the dependencies list, select the following JAR files:
        • dseb.jar
        • dsecsm.jar
        • dsecss.jar
        • dsed.jar
        • dseflp.jar
        • dsegb.jar
        • dsesym.jar
        • dsetde.jar
        • dsehcon.jar
      2. In the main-class text field, enter:
        com.ibm.btt.samples.appl.OpenDesktop
  7. Define the servlets that the Java Client Sample Application requires:
    1. From the J2EE perspective, open the Web Deployment Descriptor under the BTTJavaSampleWeb project and select the Servlets tab.
    2. Add a servlet with the following parameters:
      • Matching servlet: StartServerServlet
      • Display name: StartServerServlet
      • Initialization parameters:
        • dseIniPath: http://127.0.0.1:9080/BTTJavaSampleWeb/dse/dse.ini
      • URL mapping: /StartServer
    3. Add a servlet with the following parameters:
      • Matching servlet: CSReqProtocolServlet
      • Display name: CSReqProtocolServlet
      • URL mapping: /servlet/com.ibm.dse.cs.servlet.CSReqProtocolServlet
      • Loadon Startup –1
    4. Add a servlet with the following parameters:
      • Matching servlet: CSNotifSrvToClProtocolServlet
      • Display name: CSNotifSrvToClProtocolServlet
      • URL mapping: /servlet/com.ibm.dse.cs.servlet.CSNotifSrvToClProtocolServlet
    5. Add a servlet with the following parameters:
      • Matching servlet: CSNotifClToSrvProtocolServlet
      • Display name: CSNotifClToSrvProtocolServlet
      • URL mapping: /servlet/com.ibm.dse.cs.servlet.CSNotifClToSrvProtocolServlet
    6. Add a servlet with the following parameters:
      • Matching servlet: CSAssignServiceIdAndServerTIDProtocolServlet
      • Display name: CSAssignServiceIdAndServerTIDProtocolServlet
      • URL mapping: /servlet/com.ibm.dse.cs.servlet.CSAssignServiceIdAndServerTIDProtocolServlet
  8. Select the Listener page and add listener TimeoutHandler in com.ibm.btt.sm package
  9. Select the Enviroment page and add the dseIniPath with String value c:/dse/dse.ini or anywhere to the server dse.ini path.
  10. Import CHAEJB.jar, BTTFormatterEJB.jar and BTTsvcinfra.jar as EJB modules Open the manifest.mf for each of the following projects:
    • CHAEJB add
    • BTTJavaSampleUserDefinedClass.jar bttbase.jar
    • BTTsvcinfra.jar add
    • bttbase.jar bttfmt.jar bttjdbjsvc.jar bttjdbtsvc.jar BTTJa
    • vaSampleUserDefinedClass.jar
    • BTTFormatterEJB add
    • Bttbase.jar

    Import CHAWeb.war, BTTServicesInfra.war as Web Modules.

  11. Export the Enterprise Application to an EAR file by right clicking the BTTJavaSample project and selecting Export. Use the following settings in the Export Wizard:
    • Export destination: EAR file
    • Resources to export: BTTJavaSample
    • Destination file: localPath\BTTJavaSample (Note that the extension ".ear" is added by default)

    Optionally, select the check box for exporting the source files.