Hi Zach,
It is still not implemented. We are waiting on JSR 299/330.
In the mean time you can do one of two things:
1) Create your own injectable provider to inject EJBs:
http://markmail.org/search/?q=list%3Anet.java.dev.jersey.users+Resource+injection#query
:list%3Anet.java.dev.jersey.users%20Resource%20injection%20order
%3Adate-backward+page:6+mid:mnmoaksdyaoiq6le+state:results
2) Make PicturesResource a stateless or singleton bean and resource.
You need to use a version of GlassFish that is equal to or greater
than preview.
Hope this helps,
Paul.
On Aug 26, 2009, at 8:35 PM, Zach Cox wrote:
> Hi - I'm using GlassFish v3 Prelude with the jersey and glassfish-ejb
> components installed. I have a stateless session bean and a root
> resource, and am trying to get the bean injected into the resource:
>
> @Stateless
> public class PictureEjb {
>
> }
>
> @Path("/pictures")
> public class PicturesResource {
> @EJB
> private PictureEjb pictureEjb;
> }
>
> However, the pictureEjb instance is always null. I noticed this
> thread from Feb 2009 that seems to say that EJB injection into
> resources is not supported in JAX-RS 1.0, but is supported in JAX-RS
> 1.1:
>
> http://n2.nabble.com/Cannot-get-injected-a-reference-of-a-stateless-EJB-td2364551.html
>
> The GlassFish admin console says the installed Jersey component is
> version 1.1.1-1.0, which I assume is 1.1+ and should support EJB
> injection into resources, but it doesn't seem to be working...
>
> Am I doing something wrong or is EJB injection into resources still
> not supported?
>
> Thanks,
> Zach
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>