I have multiple instances of the Appserver running and I want to access a Remote EJB between them. What's the best way to do so in JBoss?
Below is the way Glassfish handles this:
E.g., assume we have a web application running in a non-clustered app server instance on host1 that wants to access a Remote Stateless Session bean in an app server instance on host2. The target Remote EJB has a global JNDI name of Foo.
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>
Try
<jndi-name>jnp://host2:1099/Foo</jndi-name>