users@glassfish.java.net

issues using an EJB from a cluster

From: <glassfish_at_javadesktop.org>
Date: Thu, 14 Aug 2008 06:37:31 PDT

I have a project with a web-app and multiple EJBs which would refer to a remote EJB by corbaname.


The sun-web.xml of the servlet appears as follows, except for where I omit specifics, and is perfectly able to use the remote EJB. (Though I haven't tested yet that things run smoothly if server-01 goes down)

<sun-web-app>
<ejb-ref>
<ejb-ref-name>RemoteEJBName</ejb-ref-name>
<jndi-name>
corbaname:iiop:server-01:port,iiop:server-02:port#com.lexi.package.Class
</jndi-name>
</ejb-ref>
</sun-web-app>


The sun-ejb-jar.xml file for this application appears as follows, except for where I omit specifics, and results in a corba exception when trying to resolve a URL anytime I would need to access the remote EJB.

<sun-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>EJBName1</ejb-name>
<ejb-ref>
<ejb-ref-name>RemoteEJBName</ejb-ref-name>
<jndi-name> corbaname:iiop:server-01.lexi.com:portnumber,iiop:server-02.lexi.com:portnumber#com.lexi.package.Class
</jndi-name>
</ejb-ref>
</ejb>
<ejb>
<ejb-name>EJBName2</ejb-name>
<ejb-ref>
<ejb-ref-name>RemoteEJBName</ejb-ref-name>
<jndi-name>
corbaname:iiop:server-01.lexi.com:portnumber,iiop:server-02.lexi.com:portnumber#com.lexi.package.Class
</jndi-name>
</ejb-ref>
</ejb>
</enterprise-beans>
</sun-ejb-jar>

Is this the appropriate way to specify that the remote EJB can be found on either of two machines if need be?

When omitting the second server from the sun-ejb-jar.xml file everything works as it is meant to, though the sun-web.xml has no troubles with it eitherway. It's odd to me that corba has issues with the "string->object conversion" when generating an appropriate URL from one but not the other.
[Message sent by forum member 'robstone' (robstone)]

http://forums.java.net/jive/thread.jspa?messageID=293327