atom feed29 messages in net.java.dev.glassfish.usersRe: JAX-RS on Glassfish 3.1: @EJB inj...
FromSent OnAttachments
glas...@javadesktop.orgJun 15, 2010 6:13 am 
Paul SandozJun 15, 2010 6:32 am 
glas...@javadesktop.orgJun 15, 2010 6:44 am 
Paul SandozJun 15, 2010 7:02 am 
glas...@javadesktop.orgJun 15, 2010 7:12 am 
Paul SandozJun 15, 2010 7:31 am 
glas...@javadesktop.orgJun 15, 2010 8:12 am 
glas...@javadesktop.orgJun 15, 2010 2:02 pm 
glas...@javadesktop.orgJun 15, 2010 2:17 pm 
glas...@javadesktop.orgJun 15, 2010 2:37 pm 
Paul SandozJun 16, 2010 1:49 am 
Paul SandozJun 16, 2010 2:08 am 
glas...@javadesktop.orgJun 16, 2010 5:07 am 
glas...@javadesktop.orgJun 16, 2010 5:25 am 
Paul SandozJun 16, 2010 5:43 am 
Paul SandozJun 16, 2010 5:46 am 
glas...@javadesktop.orgJun 16, 2010 5:58 am 
glas...@javadesktop.orgJun 16, 2010 5:59 am 
Paul SandozJun 16, 2010 7:08 am 
glas...@javadesktop.orgJun 16, 2010 8:02 am 
Paul SandozJun 16, 2010 8:29 am 
glas...@javadesktop.orgJun 16, 2010 8:49 am 
Paul SandozJun 16, 2010 9:20 am 
glas...@javadesktop.orgJun 16, 2010 9:33 am 
Paul SandozJun 16, 2010 9:42 am 
glas...@javadesktop.orgJun 16, 2010 10:15 am 
Paul SandozJun 17, 2010 3:26 am 
glas...@javadesktop.orgJun 17, 2010 5:33 am 
Paul SandozJun 17, 2010 6:06 am 
Subject:Re: JAX-RS on Glassfish 3.1: @EJB injection?
From:Paul Sandoz (Paul@Sun.COM)
Date:Jun 15, 2010 6:32:59 am
List:net.java.dev.glassfish.users

Hi Laird,

For this to work you need to identify the resource class a managed bean. There are three options:

1) Annotate with @ManagedBean (Jersey will defer to the app container to instantiate and it will managed the life-cycle);

2) Annotate with @Stateless or @Singleton to make it an EJB; or

3) Annotation with with a CDI-based scope annotation such as @RequestScoped.

There are currently some limitations for 1) and 3). Constructor injection is not supported. We are investigating improved CDI integration such that those limitations will be removed for 3).

Hth, Paul.

On Jun 15, 2010, at 3:23 PM, glas@javadesktop.org wrote:

I need to know if @EJB injection is supposed to be working for a JAX- RS resource class in Glassfish 3.1 b04 or later.

Specifically, I have a resource class that I would like to place the following in:

@EJB // happy to either leave empty or supply the proper "lookup" string private FooManager myEjb;

This does not work in JBoss. It is required by the Java EE specification. On Glassfish, I find that it does not work either, which surprises me; I feel like I've seen it working before.

Any known issues around this?

Thanks, Laird [Message sent by forum member 'ljnelson']

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