2.2. Configuring the communication protocol and JNDI

JOnAS provides a multi-protocol support through the integration of the CAROL component.

Supported communication protocols are the following:

For each of these protocols, the clustering of RMI objects can be enabled with the component CMI.

2.2.1. Choosing the Protocol

The choice of the protocol is made in the carol.protocols property of carol.properties file in JONAS_BASE/conf directory.

carol.protocols=jrmp

2.2.1.1. configuring jrmp protocol

carol.protocols=jrmp 1
carol.jrmp.url=rmi://localhost:1099 2
carol.jvm.rmi.local.call=false 3
carol.jvm.rmi.local.registry=false 4
carol.jrmp.server.port=0 5
carol.jrmp.interfaces.bind.single=false 6

1

choice of the protocol or list of protocols

2

connexion url to the RMI registry the hostname (localhost) and port number must be changed if needed. In a distributed configuration changing the hostname is mandatory.

3

if true local calls are optimized: calls to methods of the remote interface are treated as call to local methods (it is not always possible depending on the packaging of the application).

4

if true a local Naming context is used. This must be used only with a collocated registry and it is mandatory when the jonas.security.manager property of jonas.properties is set to true.

5

exported objects will listen on this port for remote method invocations. 0 means random port. Specify a port may be useful when the server run behind a firewall.

6

if true use only a single interface (choosen from the url) when creating the registry. False means use all interfaces available.

2.2.1.2. configuring RMI/IIOP protocol

The JacORB implementation of RMI over the IIOP is used. The configuration file of JacORB is the $JONAS_BASE/conf/jacorb.properties file.

As for the other protocols RMI over IIOP is ready to used in the default distribution. It is only for tuning purpose that the $JONAS_BASE/conf/jacorb.properties file must be customized.

By default the CORBA Naming service is run using the port 2001 (as it is set in the carol.properties file)

So the only thing to do for working in RMI over IIOP is to set the property protocols in carol.properties:

carol.protocols=iiop
# RMI IIOP URL
carol.iiop.url=iiop://localhost:2001
carol.iiop.server.port=0 1
carol.iiop.server.sslport=2003 2
carol.iiop.PortableRemoteObjectClass=org.ow2.jonas.registry.carol.delegate.JacORBPRODelegate  3

1

0 means random port

2

this port is used only if SSL mode is enabled (default configuration = not used).Is used to set the SSL port of the objects listener

3

delegate used by JOnAS for rmi-iiop protocol.

2.2.1.3. configuring irmi protocol

carol.protocols=irmi
carol.irmi.url=rmi://localhost:1098 1
carol.irmi.server.port=0 2
carol.irmi.interfaces.bind.single=false 3

1

for irmi the default port is 1098

2

exported objects will listen on this port for remote method invocations:0 means random port.

[Caution] Caution

if the port is set to n the port 'n + 1' will be used by the JMX server.So, for the firewall configuration, you have to open the port numbers 'n' and 'n+1'

3

if true use only a single interface when creating the registry (specified in carol.irmi.url property). Default configuration = false(use all interfaces available)

2.2.1.4. enabling clustering of RMI objects

CMI is the component to use for clustering purpose. It is embedded in the component CAROL.

CMI is just composed of wrappers and interceptors and is fully independant of the implementation of protocol. CMI relies on JGroups group-communication protocol for ensuring the replication of the cluster view. CMI provides jndi high availability, the load-balancing and fail-over at the EJB level.

For using CMI with a protocol (in addition to the activation of service cmi), a property must be added in carol.properties:

carol.jrmp.cmi=true 1
carol.iiop.cmi=true
carol.irmi.cmi=false 2

1

Enable clustering with jrmp

2

Disable clustering with imi

[Note] Note

By default, the property is set at true.

2.2.1.5. multi protocol configuration

JOnAS can be configured to use several protocols simultaneously. To do this, just specify a comma-separated list of protocols in the carol.protocols property of the carol.properties file. For example:

carol.protocols=iiop,jrmp
carol.jrmp.url=rmi://localhost:1099
carol.iiop.url=iiop://localhost:2001
[Caution] Caution

When iiop is used in a multiprotocol configuration, it must appear at the first position in the protocol list.