3.2. Configuring the JOnAS Environment

3.2.1. The JOnAS Configuration File

The JOnAS server is configured via a configuration file named jonas.properties. It contains a list of key/value pairs presented in the Java properties file format.

The default configuration is provided in $JONAS_ROOT/conf/jonas.properties (refer to $JONAS_BASE/conf/jonas.properties). This file, which holds all possible properties with their default values, is mandatory. The JOnAS server looks for this file at start time in the $JONAS_BASE/conf directory ($JONAS_ROOT/conf if $JONAS_BASE is not defined).

Most of the properties are related to the JOnAS services that can be launched in the JOnAS server. These properties are described in detail in Section 3.5 Configuring JOnAS Services.

The property jonas.orb.port is not related to any service. It identifies the port number on which the remote objects receive calls. Its default value is 0, which means that an anonymous port is chosen. When the JOnAS server is behind a firewall, this property can be set to a specific port number.

When several JOnAS servers must run simultaneously, it is beneficial to set a different name for each JOnAS server in order to administer these servers.

Also note that it is possible to define configuration properties on the command line:

java -Dproperty=value

Use the jonas check command to review the JOnAS configuration state. (Refer to Section 6.1 jonas.)

3.2.2. Configuration Scripts

The JOnAS distribution contains the $JONAS_ROOT/bin/unix/setenv and $JONAS_ROOT/bin/unix/config_env configuration scripts.

These configuration scripts set useful environment variables for JAVA setup ($JAVA and $JAVAC). They add $JONAS_BASE/conf to the $CLASSPATH if $JONAS_BASE is set, otherwise they add $JONAS_ROOT/conf. These scripts are called by almost all other scripts (jclient, jonas, newbean, registry, GenIC).

Therefore, when requiring the visibility of specific .jar files, the best practice is to update the config_env file. For example, to see some of the JDBC driver classes, one or more of the variables IDB_CLASSES, ORACLE_CLASSES, and POSTGRE_CLASSES must be updated.

Another way to place an additional .jar in the classpath of your JOnAS server is to insert it at the end of the config_env file:

CLASSPATH=<The_Path_To_Your_Jar>$SPS$CLASSPATH

Note that an additional environment variable called XTRA_CLASSPATH can be defined to load specific classes at JOnAS server start-up. Refer to Chapter 5 JOnAS Class Loader Hierarchy.