users@jersey.java.net

[Jersey] Re: _at_EJB injects is always null / JNDI lookup is working

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Thu, 28 Jul 2011 10:16:58 +0200

Hi Markus,

I guess this is similar problem to what we discussed off-line.
Could you please create a reproducible test application, create
a new bug report against Jersey and attach the test application.
I think this is a problem in the Jersey/EJB integration code.

Thanks,

~Jakub

On 26.7.2011 16:22, Markus Karg wrote:
>
> Please help me before I drive nuts!
>
> In my EAR is a WAR and an EJB-JAR. The WAR contains a JAX-RS
> application that explicitly registers a single JAX-RS resource. The
> JAX-RS resource shall link to a Stateless Session Bean in the EJB-JAR.
> I deploy this to GFv3.1.1_b11.
>
> When I am programming the link manually it works:
>
> <ejb-local-ref>
>
> <ejb-ref-name>ejb/QUIPSY</ejb-ref-name>
>
> <ejb-ref-type>Session</ejb-ref-type>
>
> <local>de.quipsy.ws.QUIPSY</local>
>
> <ejb-link>SuperSimple.jar#QUIPSYBean</ejb-link>
>
> </ejb-local-ref>
>
> de.quipsy.ws.QUIPSY quipsy =(de.quipsy.ws.QUIPSY)
> *new*InitialContext().lookup("java:comp/env/ejb/QUIPSY");
>
> The variable quipsy at runtime contains a reference to an instance of
> @StatelessQUIPSYBean, which *implements*the bean's local interface
> @Localde.quipsy.ws.QUIPSY. So far so good. But we now want to get rid
> of web.xml and InitialContext.lookup(), so we now are using this code,
> which obviously should do the same as above as it declares the exact
> same information:
>
> @EJB(beanName = "SuperSimple.jar#QUIPSYBean")
>
> *public*de.quipsy.ws.QUIPSY quipsy;
>
> *But at runtime this is always null. Nothing gets injected. Neither
> there is a bug report in GF's server.log!*
>
> Please, if anybody knows what the problem is and how to solve it, tell
> me before I drive nuts!
>