users@jersey.java.net

Re: [Jersey] Injection in JAX-RS Resources?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 24 Sep 2009 09:33:25 +0200

Hi,

You need to include the EJBProvider in the set of classes declared by
MyApplication.

Note that the following still needs to be implemented:

1) support for managed beans

2) support for 299/330.

So JAX-RS resource classes annotated with @ManagedBean will appear to
work (get instantiated) but will not really be managed beans, thus EE
stuff will not get injected unless you provide something Jersey
specific to do that like EJBProvider.

I plan to implement support for 1) next week. Support for 2) is a
little more subtle. I need to understand more carefully the
relationship between a managed bean and a 299/330 class.

Paul.

On Sep 24, 2009, at 8:31 AM, Moises Lejter wrote:

> Hi! I am trying to get injection of a local session EJB into a JAX-
> RS resource,
> using NetBeans 6.8 (nightly) and Glassfish v3 b62 (which I believe use
> Jersey 1.1) - and I must be missing something... :-(
>
> I put together a little NetBeans project that has a local session
> EJB to be
> injected, and a few JAX-RS resources that I thought would result in an
> EJB being injected into an attribute of the JAX-RS resource - and the
> only one that works is the resource that is also a session bean.
>
> I even have the EJBProvider class from Paul Sandoz's blog:
> http://blogs.sun.com/sandoz/entry/ejb_injection
> and it doesn't seem to be called ... :-(
>
> Could I ask you to take a look at the project, and tell me what I
> might
> be missing? (I thought the project would b easier to see, than my
> pasting all my attempts in here...)
>
> Thank you!
>
> Moises
>
> <
> JAXRSexample
> .zip
> >---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net