This guide describes the basic interoperability between JOnAS and Weblogic Server using RMI-IIOP (the examples in this document assume that the Sun rmi/iiop of the JDK is used).
The content of this guide is the following:
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 JOnAS Configuration Guide.
For the JOnAS server to use RMI-IIOP, the JOnAS configuration requires
modification. The iiop protocol must be selected in the
file carol.properties. Refer also to the JOnAS Configuration Guide for
details about configuring the communication protocol.
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.
No modification to the EJB code is necessary. However, to deploy the EJB
for use with the iiop protocol, add the element iiop="true" on the wlappc
task when creating the build.xml.
For example:
wlappc debug="${debug}" source="ejb.jar" iiop="true" classpath="${class.path}"
To call an EJB deployed on Weblogic Server that is accessible through
RMI-IIOP, specify the JNDI url of the server name containing the EJB to call.
This url is of type: "iiop://<server>:port."
For example:
try { Properties h = new Properties(); h.put(Context.PROVIDER_URL, "iiop://<server>:<port>"); ctx=new InitialContext(h); } catch (Exception e) { ... }
Then, the EJB deployed on Weblogic server is accessed in the standard way.