users@jersey.java.net

Re: [Jersey] Re: ClassCastException on deploying ContextResolver?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 26 Apr 2010 17:01:19 +0200

On Apr 26, 2010, at 4:47 PM, ljnelson wrote:

> On Mon, Apr 26, 2010 at 10:39 AM, Paul Sandoz [via Jersey]
> <[hidden email]> wrote:
> > Jersey will look up the EJB using the class name to derive the
> > portable JNDI name, and i think the reference obtained from JNDI
> does
> > not implement ContextResolver. Need to verify.
>
> And to be clear, I don't need the implementation of ContextResolver to
> be accessed through a bean reference. I would expect that the bean
> instance would simply be created like any other POJO for these
> purposes.
>

In this case Jersey is bound by the rules of EJB 3.1. It has to get a
reference, using JNDI, from the EJB container because that container
is responsible for creating and maintaining references to EJBs.

But, because i cannot see your code i cannot tell exactly what is
going on.

The EJB sample does define MBWs as EJBs without issue:

   http://download.java.net/maven/2/com/sun/jersey/samples/jersey-ejb/1.1.5.1/jersey-ejb-1.1.5.1-project.zip

I need to verify by modifying this sample to add a ContextResolver and
see if i can reproduce.

Paul.