Setting up a TCP/IP listener for J2EE called applications

If you want a calling program to use TCP/IP to start a called program in a J2EE application client module, you must set up a TCP/IP listener for the called program.

You must meet the following requirements:

Setting the main class of an application client

To set the main class of an application client, follow these steps:
  1. Edit the project's Deployment Descriptor (application-client.xml) or manifest file (MANIFEST.MF).
  2. Under the heading Main Class, enter: com.ibm.javart.calls.listener.TcpipListenerJ2EE.

Assigning a port to the listener

To assign the listener's port, follow these steps:
  1. Open the project's Deployment Descriptor (application-client.xml).
  2. Under the heading Environment Variables, click Add.
  3. In the name field, enter tcpiplistener.port.
  4. In the type field, enter java.lang.Integer.
  5. In the value field, type a port number. This should be the same value given in the serverID field of the calling program's linkage options part.

Running the application client

An application client can be started in either of two ways; the options available to you depend on which J2EE server you use:
  • If you use the WebSphere® Application Server, you can start the application client from the workbench by using the launch configuration. Follow these steps:
    1. Locate the Run menu item in the workbench. Click Run > Run.
    2. Click the type of launch configuration appropriate for your server. For example, for WebSphere Application Server it is WebSphere v6.1 Application Client.
    3. Select an existing configuration. Alternatively, you can click New to create a new configuration. You must enter the names of the application client and its enterprise application (EAR) in the appropriate fields.
  • Start the application client from the command line. The command will vary depending on your J2EE server, so consult your server's documentation. For WebSphere Application Server, you can use launchClient.bat, which is in the WebSphere Application Server installation directory, in the bin subdirectory. You can start launchClient.bat by entering the following at the command prompt:
    launchClient myCode.ear -CCjar=myJar.jar
    myCode
    The name of your enterprise archive (EAR).
    myJar
    The name of the application client JAR file.
    The name of the JAR file is only necessary if you have multiple client JAR files in your EAR file. You can find more information on launchClient.bat in the documentation for WebSphere Application Server.

Feedback