users@jersey.java.net

Re: [Jersey] _at_Resource

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 22 Jul 2008 11:33:44 +0200

Jakub Podlesak wrote:
> On Mon, Jul 07, 2008 at 12:15:42PM +0200, Markus Karg wrote:
>> I have deployed a Jersey-0.8 based resource in GlassFish v2ur2.
>> It seems as if @Resource in my resource is not getting injected.
>> I assume that the reason is that my JAX-RS resource is not a managed component, while com.sun.jersey.spi.container.servlet.ServletContainer actually is one (it is a Servlet).
>
> At the moment, injection is managed by Jersey runtime.
> And AFAIK, support for @Resource is missing at the moment.
>

Right, Jersey is not fully EE compliant yet, this will only occur when
we sync up with EE 6, when it is ready.

In the interim time there is a pluggable injection mechanism you can
implement components for that may do what you require, see:

http://blogs.sun.com/sandoz/entry/ejb_injection


>> I can live with that for now (v2ur2), but how will that look like in GFv3? Will GFv3 treat JAX-RS resources as managed components (and such inject into those)?
>
> The support in GFv3 should be as you described.
> But if you want just tell me what you need to be injected,
> i can try to implement the injection provider for you to work
> already in GFv2.
>

It is not really a v2/v3 issue it is more of an EE issue.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109