users@glassfish.java.net

Re: SessionBean Lookup/Injection from a pojo within the same EAR

From: <glassfish_at_javadesktop.org>
Date: Wed, 17 Sep 2008 08:20:52 PDT

So your managed bean is the environment that your POJO is going to inherit. You managed bean will either need to declare its dependency on the session bean either through annotation or through the web.xml deployment descriptor.

Think of it as just as if you were calling the session bean directly from the management bean. You would either need an @EJB annotation injecting the session bean interface at a method or property level or injecting the JNDI name at the class level or you would need to do it the old fashion way by using a:

[i] <ejb-local-ref>
        <ejb-ref-name>ejb/MessageManagerBean</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local-home/>
        <local>MessageManagerLocal</local>
    </ejb-local-ref>
[/i]

in your web.xml.
[Message sent by forum member 'bbergquist' (bbergquist)]

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