Run the J2EE application client
Use the launchClient script to start your J2EE application client. The launchClient script performs these actions:
- It starts the application client run time. See J2EE application client class loading for more information about how the J2EE application client runtime uses the WAS classloaders.
- It initializes the Java Naming and Directory Interface (JNDI) name space with the enterprise beans and resources that are defined in the J2EE application client.
- It loads the class that you specified as the main class when you assembled your J2EE application client.
- It runs the main() method of the J2EE application client.
- When your program terminates, the J2EE application client runtime cleans up the environment and the Java virtual machine ends.
The launchClient script is included as part of the client runtime support product, and is located in the bin subdirectory. Here are some examples of the default location of the script on various platforms:
- Windows 32-bit: C:\WebSphere\AppServer\bin\launchClient.bat
- AIX and Solaris: /usr/WebSphere/AppServer/launchClient.sh
- iSeries: /QIBM/ProdData/WebAS5/Base/bin/launchClient
- iSeries redistributable client runtime: /WebSphere/AppClient/bin/launchClient
(For more information, see Redistribute the client runtime for iSeries.)
You may pass parameters to the launchClient script and, optionally, to your J2EE application client program. See The launchClient script for more information about parameters.
Specifying the server name and server port number
The launchClient script uses the environment variable COMPUTERNAME for the default -CCBootstrapHost property value and 2809 for the default -CCBoostratpPort property value. Use the -CCBootstrapHost property to specify the iSeries host-name where WAS is running. You can also override the -CCBootstrapPort value if you have changed the bootstrap port for your WAS instance.
These values can be overridden by invoking the launchClient script in this way:
launchClient myapp.ear -CCBootstrapHost=host -CCBootstrapPort=portwhere host is the host name for your iSeries server and port is the port on which the name service for your application server is listening. The default value for the name service port is 2809.
Note: If you are using JMS resources, specify the -CCsoapConnectorPort=port argument also.
For example:
launchClient myapp.ear -CCBootstrapHost=PRODSVR -CCBootstrapPort=10400You can also override the default by specifying the value in a properties file and passing the file name to the launchClient script.
Specifying directories for expanded EAR files
Each time the launchClient script is called, it extracts the EAR file to a random directory name in the temporary directory on your hard drive. See Specify the directory for an expanded EAR file for information on how to change this default behavior.
Format of a launchClient properties file
The format of the file is one launchClient -CC parameter per line without the -CC prefix. For example:
verbose=true classpath=c:\mydir\util.jar;c:\mydir\harness.jar;c:\production\G19\global.jar BootstrapHost=PRODSVR tracefile=c:\WebSphere\mylog.txtYou then specify the name of the properties file using the -CCpropfile property. For example, the following would be the command-line for invoking the launchClient script using a properties file named myproperties.properties:
launchClient -CCpropfile=myproperties.propertiesRunning a J2EE application client with security enabled
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 J2EE application client works as expected. The sas.client.props file is used for security information. On iSeries, this file is located using the -instance parameter.
For more information, see the following topics:
- Example: Use a Java 2 security manager with a J2EE application client
- Example: Enable Java 2 security prior to J2EE application client runtime initialization
Tips for migrating J2EE application client code:
If your J2EE application client uses resource references, and you have configured those resources using the Application Client Resource Configuration Tool (ACRCT), run the ClientUpgrade command to migrate the resource configuration information in WAS V5.