Glassfish - Sharing EJB Web Application Between Nodes

I have a Glassfish server with multiple EJB wars deployed to several different nodes. I want one of the applications (deployed to node1) to be "visible" to all applications deployed to different nodes so that they can inject multiple remote beans from it. However, I am only allowed to have one instance of this application per wole server, so deploying it separately across all nodes is not possible. Is such a setting possible in a glass box 3.1?

+3


source to share


1 answer


This can be accomplished using deployment descriptors:

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

In your sun-web.xml (or glassfish-web.xml, both will work in this case) define ejb-ref

like this:



<ejb-ref>
    <ejb-ref-name>fooejbref</ejb-ref-name>
    <jndi-name>corbaname:iiop:node_name:node_IIOP_port#foo.bar.YourEJBRemote</jndi-name>
</ejb-ref>

      

This is not very convenient - you will need to define what you need for each remote bean and add such a handle to each application that it needs. However, it should work and I don't know a better way.

+1


source







All Articles