Chapter 3. JOnAS Configuration

This chapter describes how to configure JOnAS.

3.1. JOnAS Configuration Rules

As described in Chapter 2 Getting Started with JOnAS, JOnAS is pre-configured and ready to use directly with RMI/JRMP for remote access, if visibility to classes other than those contained in the JOnAS distribution in $JONAS_ROOT/lib is not required.

To use RMI/IIOP for remote access or to work with additional Java classes (for example, JDBC driver classes), you must perform additional configuration tasks, such as setting a specific port number for the registry.

The JOnAS distribution contains a number of configuration files in $JONAS_ROOT/conf directory. These files can be edited to change the default configuration. However, it is recommended that the configuration files needed by a specific application running on JOnAS be placed in a separate location. This is done by using an additional environment variable called JONAS_BASE.

3.1.1. JONAS_BASE Environment Variable

WarningWarning
 

JOnAS configuration files are read from the $JONAS_BASE/conf directory. If JONAS_BASE is not defined, it is automatically initialized to $JONAS_ROOT.

There are two ways to use the JONAS_BASE environment variable:

  1. Perform the following actions:

    1. Create a new directory and initialize JONAS_BASE with the path to this directory.

    2. Create the following sub-directories in $JONAS_BASE:

      • conf

      • ejbjars

      • apps

      • webapps

      • rars

      • logs

    3. Copy the configuration files located in $JONAS_ROOT/conf into $JONAS_BASE/conf. Then, modify the configuration files according to the requirements of your application, as explained in the following sections.

  2. Perform the following actions:

    • Initialize $JONAS_BASE with a path.

    • Change to the $JONAS_ROOT directory and enter:

      ant create_jonasbase

      This copies all the required files and creates all the directories.

NoteNote
 

The build.xml files provided with the JOnAS examples support JONAS_BASE. If this environment variable is defined prior to building and installing the examples, the generated archives are installed under the appropriate sub-directory of $JONAS_BASE. For example, the EJB-JAR files corresponding to the sample examples of $JONAS_ROOT/examples/src/ are installed in $JONAS_BASE/ejbjars.