users@glassfish.java.net

Re: how is sun-ejb-jar.xml configured to allow remote AND local access (EJB2.1)

From: <glassfish_at_javadesktop.org>
Date: Sun, 13 Jan 2008 16:17:46 PST

Well -- thanks to forum contibuter DKOPER -- I now understand that I do not need sun-ejb-jar.xml at all.

In my case, the "helper" class doing the JNDI lookup existed in the EJB module source package.
 
Because of this, I wrongly assumed that that any all related configuration -- affecting a successful JNDI lookup -- would have to be made to configuration files within the EJB module.

This was, of course, incorrect... What I was missing was an ejb-local-ref entry in my WEB modules web.xml file.

like so,
[code]

(within web.xml in the "enterprise" project's WEB module)
-
-
-
    <ejb-local-ref>
        <ejb-ref-name>DddEJBLocalHome</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local-home>ddd.ejb.DddEJBLocalHome</local-home>
        <local>ddd.ejb.DddEJBLocal</local>
        <ejb-link>dddEAR-ejb.jar#DddEJBBean</ejb-link>
    </ejb-local-ref>
-
-
-
[/code]

After making this change, the JNDI lookup worked successfully.

(Thanks again to forum contributer DKOPER for the helpful explanation)
[Message sent by forum member 'sairndain' (sairndain)]

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