35.2. Setting the JOnAS Environment

The suggested architecture requires two JOnAS server instances. You can do this as follows:

  1. Create two base directories. For example JONAS_REGISTRY and JONAS_EJB.

  2. Set the JONAS_BASE environment variable so that it points towards the JONAS_REGISTRY directory.

  3. In the $JONAS_ROOT directory, type: ant create_jonasbase

  4. Set the JONAS_BASE environment variable so that it points towards the JONAS_EJB directory.

  5. In the $JONAS_ROOT directory, type: ant create_jonasbase

The JOnAS servers may now be configured independently.

35.2.1. Configuring the Registry Server

The "Registry" server is the JOnAS server that hosts the registry service. Its configuration files are in JONAS_REGISTRY/conf.

In the jonas.properties files, declare only the registry and jmx services:

jonas.services    registry,jmx

In the carol.properties file, declare the rmi protocol:

carol.protocols=rmi

You can also configure its port:

carol.rmi.url=jrmi://localhost:2000

35.2.2. Configuring the EJB Server

The "EJB" server is the JOnAS server that is used as the application server. Its configuration files are in JONAS_EJB/conf. Libraries must be added in JONAS_EJB/lib/ext.

In the jonas.properties files, set the registry service as remote:

jonas.service.registry.mode    remote

In the carol.properties file, declare the rmi protocol and set the correct port:

carol.protocols=rmi
carol.rmi.url=jrmi://localhost:2000

In lib/ext, the following libraries must be added: