This chapter describes the basic interoperability between JOnAS and a BEA WebLogic Server using RMI-IIOP.
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.
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.