Running a Java EE client application with launchClient
After deploying a Java EE client application onto a machine with an Application Client installation or in a WAS node, we can start the application using the launchClient command on that machine.
Before we can use the launchclient command to run a Java EE client application, you must have deployed the application.
This task only applies to Java EE client applications.
The Java EE specification requires support for a client container that runs Java applications (known as Java EE client applications) and provides Java EE services to the applications. Java EE services include naming, security, and resource connections.
- (iseries) Start the Qshell environment.
On the CL command line, type the command:
STRQSH
- Enter the following command to launch Java EE application clients:
app_client_root/bin/launchClient
(iseries) where app_client_root is /QIBM/ProdData/WebSphere/AppServer/V85/Base or /QIBM/ProdData/WebSphere/AppServer/V85/ND.
- Pass parameters to the launchClient command or to the application client program as well. The launchClient command allows us 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.
Example command line invocation syntax for the launchClient tool:
launchClient [-profileName pName | -JVMOptions options | -help | -?] userapp [-CCname=value] [app args]
where
- userapp is the path and the name of the EAR file containing the application client.
- CCname=value is the client container name-value pair parameter. See the client container parameters section, for supported name-value pair arguments.
- app args are arguments that pass to the application client.
- profileName defines the profile of the Application Server process in a multi-profile installation. The -profileName option is not required for running in a single profile environment or in an Application Clients installation.
(zos) The default is default_profile.
- JVMOptions is a valid Java standard or non-standard option string. Insert quotation marks around the string.
- help, -? prints the 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 , with command line values having the highest priority and system properties the lowest. Using this prioritization we can set and override default values.
- Specify the server name.
(zos) By default, the launchClient command uses the localhost for the BootstrapHost property value.
(iseries) By default, the launchClient command uses your_server_name for the BootstrapHost property value.
This setting is effective for testing the application client when it is installed on the same computer as the server. However, in other cases override this value with the name of the server. We can override the BootstrapHost value by invoking launchClient command with the following parameters:
launchClient myapp.ear -CCBootstrapHost=abc.midwest.mycompany.com
We 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 server security is not enabled, then the server ignores the security request, and the application client functions as expected.
Example
We can store launchClient values in a properties file, which is a good method for distributing default values. We can then override one or more values on the command line. 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=abc.westcoast.mycompany.com tracefile=c:\WebSphere\mylog.txt(iseries)
(zos)
verbose=true classpath=/usr/lpp/mydir/util.jar;/usr/lpp/mydir/harness.jar;/usr/lpp /production/G19/global.jar BootstrapHost=abc.westcoast.mycompany.com tracefile=/usr /lpp/WebSphere/mylog.txt
Subtopics
(zos) Downloading and running a Java EE client application using Java Web Start
Java Web Start technology is provided by the Java Standard Edition runtime environment to deploy Java Enterprise Edition application clients, including Thin application clients, on the remote client machine with a single click from a web browser on the client machine.
- launchClient tool
We can use the Java EE command line syntax for the launchClient tool for WebSphere Application Server.
- (dist) Directory for an expanded EAR file
We can archive the Manifest.mf client Java Archive (JAR) files instead of automatically cleaning them up after the application exits.
Application client troubleshooting tips