-
1. Re: servlet in one ear referencing ejb in another ear
adrian.brock Feb 24, 2003 3:09 AM (in response to nobel)A strict reading of the spec (although the wording is
not clear) requires you to use an <ejb-ref>
not an <ejb-local-ref> for access outside
the ear. That is how JBoss interprets it.
Also, because it is outside the ear, you cannot use an
<ejb-link> you must specify a <jndi-name> for the
<ejb-ref> in jboss-web.xml
Look at docs/dtd/jboss-web_3_0.dtd for more info.
Regards,
Adrian -
2. Re: servlet in one ear referencing ejb in another ear
nobel Feb 27, 2003 4:08 AM (in response to nobel)Ok, adding an ejb-ref to the ejb of interest in web.xml and then pointing out the JNDI name of that ejb in jboss-web.xml does the trick.
To my surprise I noticed that my servlet in app1.ear could reference an ejb component in a module in app2.ear if I "JNDI look up" the last part of the complete JNDI name. Just use "ejb/component" instead of "java:comp/env/ejb/component". Is that behaviour something you may count on?
/Niklas -
3. Re: servlet in one ear referencing ejb in another ear
adrian.brock Feb 27, 2003 3:03 PM (in response to nobel)Yes,
But it is not the recommended method.
In principle the war should reference
java:comp/env/ejb/component
Then you can later change the dds to point at
ejb/someOtherComponentThatDoesTheJobBetter
without recompiling the web component.
Regards,
Adrian