Deploying the application on WebSphere Application Server 5.1.1

The Java(TM) Client Sample Application demonstrates how to create teller application that can have Java clients. You do not need to make any coding changes to run either type of client. The Java client requires a set of JAR files (described in the procedures) .

The Java Client Sample Application can be installed on a Windows(R) 2000 server, Windows 2000 Advanced Server, Windows Server 2003, Solaris, AIX(R) and Linux(R) on Intel(R) or Linux SLES7 zSeries(R) server by the same deloyment. The procedure below describes how to deploy and run the sample on IBM(R) WebSphere(R) Application Server V5.1.1. If you are using a different edition of WebSphere Application Server, some of the details in the instructions may differ and you will have to adjust the procedure accordingly.

The procedure assumes that you will install the EAR file onto WebSphere Application Server as is and then modify it to reflect your environment. If you want to perform the modifications within WebSphere Studio Application Developer Integration Edition, you can do so and then repackage the changes into an EAR file.

Note that the Java Client Sample Application Application can have three types of client: Java, HTML with JSPs, and HTML with applets. See Java Client Sample Application clients for information on these clients. Before you begin to deploy the sample application, you should decide which clients you want to use. You can deploy the sample application so that it uses one, two, or all three types of client.

To deploy the Java Client Sample Application, do the following:

  1. To enable the sample application to interact with your desktop, do the following:
    1. Open the Services window. (In Windows 2000, click Start > Settings > Control Panel > Administrative Tools and then double-click Services.)
    2. Right-click the IBM WebSphere Application Server service and then click Properties.
    3. Select the Log On tab and click Local System account. Enable Allow services to interact with desktop. This step allows you to see the trace window and the progress bars when the StartServerServlet starts.
    4. Click Apply.
  2. Start the WebSphere Application Server.
  3. Start the WebSphere Administrator's Console.
  4. In the console, install the Java Client Sample Application:
    1. Expand the Applications node and click Install Enterprise Application.
    2. In the Install Enterprise Application Wizard panel, click Browse. Browse to the directory containing the BTTJavaSample file. You can find the file in the ear directory of the Branch Transformation Toolkit installation.
    3. Set the application name and click Next.
    4. Click Next until the Finish button is enabled and click Finish.
  5. Install DummySnaLu0 in the <toolkit root>\jars directory in the WebSphere Application Server:
    1. In Websphere Administration Console, select Resources\Resource Adapter\Install RAR and add the following:

      name : dummysnalu0

    2. Define JAAS Authentication entries: Select Security\JAAS Configuration\J2C Authentication Data, then click New, add the following:
      • Alias: sna
      • User id: sna
      • Password: sna
    3. Define the J2C Connection Factories: Select Resources\Resource Adapter\dummysnalu0, click J2C Connection Factories, then click New, add the following:
      • Name: snalu0
      • JNDI name: snalu0
      • Component-managed Authentication alias: sna
      • Container-managed Authentication alias: sna
    4. Select Resources\ Resource Adapter\dummysnalu0\J2C Connection Factories\snalu0, click Custom Properties, add the following:
      TestFile = http://127.0.0.1:9080/BTTJavaSampleWeb/response.res
      username = sna
      password = sna
  6. If you want the Java Client Sample Application to use the Java client, modify the configuration files to reflect the server name and port that you will be using for the sample:
    1. Edit the <WAS installedApps directory>\BTTJavaSample.ear\BTTJavaSampleWeb.war\dse\dse.ini file to replace all occurrences of the 127.0.0.1 IP address with the name or IP address of the server that will contain the sample application. You can find them in the "HTML ATTRIBUTES" and "Path to generic definition files" sections of the file:
      <!-- Path to generic definition files -->
      
      <kColl id="paths">
        <field id="entities" value="http://127.0.0.1:9080/BTTJavaSampleWeb/dse/client"/>
        <field id="desktop" value="http://127.0.0.1:9080/BTTJavaSampleWeb/dse/desktop"/> 
      </kColl>
    2. If you are not using the default port of 9080, change all occurrences of 9080 with the number of the port that the sample will use. You can find them in the "HTML ATTRIBUTES", "Trace Settings", and "Path to generic definition files" sections of the file:
      <!-- Trace Settings -->
      
      <kColl id="traces">
      ...
        <field id="servletsEngineLogPort" value="9080"/>
        ...
      </kColl>
      
      <!-- Path to generic definition files -->
      
      <kColl id="paths">
        <field id="entities" value="http://127.0.0.1:9080/BTTJavaSampleWeb/dse/client"/>
        <field id="desktop" value="http://127.0.0.1:9080/BTTJavaSampleWeb/dse/desktop"/> 
      </kColl>
    3. If the traceToFile field in the Trace Settings section is set to "yes", make sure the traceFileName field has a valid path and file name.
    4. Save the file.
    5. If you are not using the default port of 9080, edit the <WAS installedApps directory>\BTTJavaSample.ear\BTTJavaSampleWeb.war\dse\server\dse.ini file to replace 9080 with the number of the port that the sample will use. You can find it in the "Trace Settings" section of the file:
      <!-- Trace Settings -->
      
      <kColl id="traces">
      ...
        <field id="servletsEngineLogPort" value="9080"/>
        ...
      </kColl>
    6. If the traceToFile field in the Trace Settings section is set to "yes", make sure the traceFileName field has a valid path and file name.
    7. Save the file.
    8. Change the server name in the dseIniPath setting for the StartServerServlet. To do this, edit the \BTTJavaSample.ear\BTTJavaSampleWeb.war\WEB-INF\web.xml file to replace the 127.0.0.1 IP address with the name or IP address of the server that will contain the sample application. If you are not using the default port, replace 9080 with the port number that you are using.
    9. Save the file.
  7. The procedure also assumes that you are using the default context. If you are not, see Changing the context root in WebSphere Application Server for information the changes you need to make to the configuration and resource files to compensate.
  8. If you modified any files in steps 11, 12, or 13 and you want to synchronize the sample EAR file with these changes, do the following:
    1. Start the ASTK.
    2. Open the application by browsing to the <WAS installedApps directory>\BTTJavaSample.ear directory and open the EAR.
    3. Click File > Save As to save the changes to application's EAR file.
  9. In the left frame, click Enterprise Applications. Enable the BTTJavaSample checkbox and then click Start.
  10. If you are using a Java client, do the following in the client:
    1. Install the client's JAR files to any directory in your client machine. The following is a list of JAR files and where you can obtain them:
      • BTTJavaSampleClient.jar - From the <WAS installedApps directory>/BTTJavaSample.ear directory.
      • dsegb.jar, dseb.jar, dsed.jar, dsecsm.jar, dsecss.jar, dseflp.jar, dsesym.jar, and dsetde.jar - From the <WAS installedApps directory>/BTTJavaSample.ear directory.
      • xerces.jar and j2ee.jar - From the WebSphere Application Server installation.
      • BTTJavaSampleClient.jar - From the <WAS installedApps directory>/BTTJavaSample.ear directory.
      • dsegb.jar, dseb.jar, dsed.jar, dsecsm.jar, dsecss.jar, dseflp.jar, dsesym.jar, and dsetde.jar - From the <WAS installedApps directory>/BTTJavaSample.ear directory.
      • xerces.jar and j2ee.jar - From the WebSphere Application Server installation.
    2. Open a command prompt and include the JAR files in the client's classpath. For example, if you installed the JAR files to c:\jars, use the following command:
      set
      classpath=c:\jars\BTTJavaSampleClient.jar;c:\jars\dsegb.jar;
      c:\jars\dseb.jar;c:\jars\dsed.jar;c:\jars\dsecsm.jar;c:\jars\dsecss.jar;
      c:\jars\dseflp.jar;c:\jars\dsesym.jar;c:\jars\dsetde.jar;c:\jars\xerces.jar;
      c:\jars\j2ee.jar;
      set classpath=c:\jars\BTTJavaSampleClient.jar;c:\jars\dsegb.jar;
      c:\jars\dseb.jar;c:\jars\dsed.jar;c:\jars\dsecsm.jar;c:\jars\dsecss.jar;
      c:\jars\dseflp.jar;c:\jars\dsesym.jar;c:\jars\dsetde.jar;c:\jars\xerces.jar;
      c:\jars\j2ee.jar;
    3. Start the application by entering the following at the command prompt where you set the classpath:
      java com.ibm.btt.samples.appl.OpenDesktop -p 
      http://127.0.0.1:9080/BTTJavaSampleWeb/dse/dse.ini

      The -p parameter contains the path to the configuration file located on the server. If you changed the server name or port from the default values, make the appropriate adjustment to this parameter.

  11. If you have installed the Application Client Launcher provided by WebSphere Application Server and you want to use it to launch the Java client, do the following in the client machine:
    1. Open a command prompt.
    2. Browse to the WebSphere/AppClient/bin directory.
    3. Enter the following command:
      LaunchClient <Sample EAR location> -p
      http://127.0.0.1:9080/BTTJavaSampleWeb/dse/dse.ini 

      Where <Sample EAR location> is the location of the EAR file for the Java Client Sample Application. If you changed the port number, replace 9080 with the port number that you are using.