users@glassfish.java.net

Debug _at_EJB (javax.ejb.EJB) annotation in Web Application

From: <glassfish_at_javadesktop.org>
Date: Sun, 15 Mar 2009 01:42:13 PDT

Hi,
I have an Enterprise Application with EJB module and Web module.
The EJB module has simple stateless session bean with local interface only.
The Web module uses the EJB module and has @EJB annotation on a field referring to the local interface of the stateless session bean.

For some reason it does not inject the bean instance. The field remain null.

I'm using NetBeans 6.5 for development so I used the built-in "Call Enterprise Bean" functionality and it add a JNDI lookup method and the following entry to my web.xml file:

    <ejb-local-ref>
        <ejb-ref-name>ObjectTypeFacade</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local-home>org.dna.aurora.core.objectTypeFacade</local-home>
        <local>org.dna.aurora.core.objectTypeFacade</local>
        <ejb-link>Aurora-ejb.jar#ObjectTypeFacade</ejb-link>
    </ejb-local-ref>

The lookup code simply create InitialContext and perform lookup for "java:comp/env/ObjectTypeFacade".

Can anyone help me understand what am I doing wrong?
What is the name of the variable should be? Should I add arguments to the @EJB annotation?

Thank you very much,
Ido.
[Message sent by forum member 'ido_ran' (ido_ran)]

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