ejb@glassfish.java.net

EJB3.0 - session bean to session bean cross app server remote ref

From: Ming Chan <Ming.Chan_at_Sun.COM>
Date: Fri, 26 Mar 2010 09:50:00 -0400

Hello,

Thanks for publishing the very detailed information here:

https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#cross-appserverremoteref

I have a follow up question.

I would like to access from one stateless session bean (SLSB) to another
stateless session bean (SLSB) using remote EJB interface. Both are
EJB3.0 session beans running on difference instances of glassfish 2.1.
Each of these session beans is running on its own glassfish instance and
these two glassfish instances do not belong to a same cluster.

The mentioned reference suggests we do the following:

Within the 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>

How to access a remote SLSB from another SLSB (rather than from a servlet) ?

Thanks in advance.

Ming