Chapter 37. RMI-IIOP Interoperability between JOnAS and BEA WebLogic

This chapter describes the basic interoperability between JOnAS and a BEA WebLogic Server using RMI-IIOP.

37.1. Accessing a JOnAS EJB from a WebLogic Server's EJB using RMI-IIOP

37.1.1. JOnAS Configuration

No modification to the EJB code is necessary. However, to deploy it for use with the iiop protocol, add the tag protocols and indicate iiop when creating the build.xml. For example:

<jonas destdir="${dist.ejbjars.dir}" classpath="${classpath}" 
  jonasroot="${jonas.root}" protocols="iiop"/>

If GenIC is being used for deployment, the -protocols option can be used. Note also that an EJB can be deployed for several protocols. For more details about configuring the communication protocol, refer to the Section 3.3 Configuring the Communication Protocol and JNDI.

For the JOnAS server to use RMI-IIOP, the JOnAS configuration requires modification. The iiop protocol must be selected in the file carol.properties. This modification will allow an EJB to be created using the RMI-IIOP protocol.

37.1.2. EJB Proxy on WebLogic

To call an EJB deployed on JOnAS that is accessible through RMI-IIOP, load the class com.sun.jndi.cosnaming.CNCtxFactory as the initial context factory. In addition, specify the JNDI URL of the server name containing the EJB to call: "iiop://<server>:port." For example:

try {
  Properties h = new Properties();
  h.put(Context.INITIAL_CONTEXT_FACTORY, 
    "com.sun.jndi.cosnaming.CNCtxFactory");
  h.put(Context.PROVIDER_URL, "iiop://<server>:<port>");
  ctx=new InitialContext(h);
  }
catch (Exception e) {
  ...
  }

Then, the JOnAS EJB is accessed in the standard way.