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):
The carol.properties specified by the -carolFile argument to the client container.
The carol.properties packaged into the client application (the JAR client).
If not located previously, it will use the carol.properties contained in the JONAS_ROOT/lib/client.jar.
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
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
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.
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.