users@glassfish.java.net

Calling EJBs on another cluster supporting balancing and failover

From: <glassfish_at_javadesktop.org>
Date: Thu, 04 Jun 2009 15:51:52 PDT

Hi. I have two Glassfish clusers (each of them has two instances). I want to call and EJB deployed in one of the clusters from the other one. So according to the FAQ document:

Within servlet :

@EJB(name="fooejbref")
private FooRemote fooRemote;

Within sun-web.xml :

  <ejb-ref>
    <ejb-ref-name>fooejbref</ejb-ref-name>
    <jndi-name>corbaname:iiop:host2:3700#Foo</jndi-name>
  </ejb-ref>

The problem is that I want to support failover and balancing. So i changed the sun-web.xml to the following:

  <ejb-ref>
    <ejb-ref-name>fooejbref</ejb-ref-name>
    <jndi-name>corbaname:iiop:host2:3700,iiop:host3:3700#Foo</jndi-name>
  </ejb-ref>

where host2 and host3 are computers representing the two instances of the cluster holding the EJBs. This is not working as only host2 gets called.

What is the correct way to perform this? Do I have to add something to sun-acc.xml? The change to sun-acc.xml must be done on the DAS instance?
Thanks in advanced for any help.
[Message sent by forum member 'mcapurro' (mcapurro)]

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