users@glassfish.java.net

Re: JAX-RS in GF 2.1 and EJB injection?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 21 Apr 2010 12:16:14 +0200

On Apr 21, 2010, at 12:12 PM, glassfish_at_javadesktop.org wrote:

> Hi,
>
> good news - jersey jax-rs works now in Glassfish 2.1 with EJB
> annotation :)

Great :-)


> I am using
> - jersey-core-1.1.5.1.jar
> - jersey-server-1.1.5.1.jar
> - jsr311-api.1.1.1.jar
>
> to get the missing ejb injection I have added the EJBProvider you
> provided in your example application.
> This provider works in GF2.1 and also in GF3.0 (I bundled the
> provider with my REST service classes)
>
> And (very important!) I inject now the Remote Interface of my EJB
> not the Local Interface!
>
> I have now two additional questions:
>
> 1. why did you not bundle this EJBProvider together with jersey-
> server and provide an servlet init-param to configure if the
> EJBProvider should be used (for JEE5) or not (for JEE6)
>

It's logged as an issue and i have not got around to adding it! One
thing i am reluctant to do is for Jersey to start supporting all the
EE-related injection support when we have it in EE 6 with duplication
of code but simple support @EJB seems appropriate, but I am not sure i
can actually support this as specified so it would be have to be used
under certain limitations and assumptions.


> 2. Did the fact that I am forced to use remote interfaces of my EJBs
> a performance issue? Did you think the the resulting code is less
> performance in JEE6 as if I would use the local EJB interfaces ?
>

I do not know. See my previous email for how to get local references
to work.

Paul.