19.2. Configuring the Client Container

19.2.1. JNDI Access

Defining the JNDI access and the protocol to use is an important part of configuration. The JOnAS server, as well as the ClientContainer, uses the values specified in the carol.properties file. This file can be used at different levels. The carol.properties is searched with the following priority (high to low):

A convenient way is to update the carol.properties of your client.jar with your customized carol.properties file. That is, jar -uf client.jar carol.properties

19.2.2. Trace Configuration

The client container client.jar includes a traceclient.properties file. This is the same file as the one in JONAS_ROOT/conf directory.

A different configuration file can be used for the traces by specifying the parameter -traceFile when invoking the client container.

The file in the client.jar can also be replaced with the command: jar -uf client.jar traceclient.properties

19.2.3. Classpath Configuration

Some jars/classes can be added to the client container. For example, if a class requires some extra libraries/classes, you can use the -cp path/to/classes option.

The classloader of the client container will use the libraries/classes provided by the -cp flag.

19.2.4. Specifying the Client to Use (EAR Case)

An EAR can contain many Java clients, which are described in the application.xml file inside the <module><java> elements.

To invoke the client container with an ear, such as java -jar client.jar my.ear, specify the Java client to use if there are many clients. Otherwise, it will take the first client.

To specify the JAR client to use from an EAR, use the argument -jarClient and supply the name of the client to use.

The earsample example in the JOnAS examples has two Java clients in its ear file.

19.2.5. Specifying the Directory for Unpacking the EAR (EAR Case)

By default, the client container will use the system property java.io.tmpdir. To use another temporary directory, specify the path by giving the argument -tmpDirto the client container.