Running application clients

The J2EE specification requires support for a client container that runs stand-alone Java applications (known as J2EE application clients) and provides J2EE services to the applications. J2EE services include naming, security, and resource connections.

You are ready to run your application client using this tool after you have:

  1. Written the application client program.

  2. Assembled and installed an application module (.ear file) in the appserver run time.

  3. Deployed the application using the ACRCT.

This task only applies to J2EE application clients.

  1. Open a command window and invoke the following script to launch J2EE application clients using the launchClient shell

    $WAS_HOME/bin/launchClient.bat
    

    The launchClient batch command starts the application client run time, which...

    • Initializes the client run time.

    • Loads the class that you designated as the main class with the Assembly Toolkit.

    • Runs the main method of the application client program.

    When your program terminates, the application client run time cleans up the environment and the JVM code ends.

  2. Pass parameters to the launchClient command or to your application client program as well. The launchClient command allows you to do both.The launchClient command requires that the first parameter is either:

    • An EAR file specifying the application client to launch.

    • A request for launchClient usage information.

    All other parameters intended for the launchClient command must begin with the -CC prefix.

    Parameters that are not EAR files, or usage requests, or that do not begin with the -CC prefix, are ignored by the application client run time, and are passed directly to the application client program.

    The launchClient command retrieves parameters from three places...

    • The command line

    • A properties file

    • System properties

    The parameters are resolved in the order listed above, with command line values having the highest priority and system properties the lowest. Using this prioritization you can set and override default values.

  3. Specify the server name.By default, the launchClient command uses the environment variable COMPUTERNAME for the BootstrapHost property value. This setting is effective for testing your application client when it is installed on the same computer as the server. However, in other cases override this value with the name of your server.

    You can override the BootstrapHost value by invoking launchClient command with the following parameters:

    launchClient appname.ear -CCBootstrapHost=abc.midwest.companyname.com
    
    You can also override the default by specifying the value in a properties file and passing the file name to the launchClient shell.

    Security is controlled by the server. You do not need to configure security on the client because the client assumes that security is enabled. If security is not enabled, the server ignores the security request, and the application client works as expected.

 Usage scenariolaunchClient-CC-CC

 verbose=true classpath=c:\mydir\util.jar;c:\mydir\harness.jar;c:\production\G19
\global.jar BootstrapHost=abc.westcoast.companyname.com tracefile=c:\WebSphere\mylog.txt 

 

See Also

launchClient tool
Use a Java 2 security manager with a J2EE application client
Enable Java 2 security prior to J2EE application client run time initialization
Application client troubleshooting tips