dev@jersey.java.net

Re: [Jersey] spring and multiple beans error

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 15 May 2009 17:30:07 +0200

On May 15, 2009, at 5:21 PM, Pedro Teixeira wrote:

>
>
> Sorry Paul if I was't clear, will try to explain my scenario is as
> follows:
>
> I'm using the
> com.sun.jersey.spi.spring.container.servlet.SpringServlet and using
> version 1.0.1
>
> and having the following resources given an error:
>
> @Path
> @Component
> class A {
>
> }
>
> @Path
> @Component
> class B extends A {
> }
>
>
> The exception complains there is multiple bean definition for A and
> suggest the use of @Inject but I'm not injection the resources
> anywhere.
>

Yes, that error message is wrong for this context and needs to be fixed.


> I just wanted to check if this is known not to be supported.
>

Hmm... this is a tricky one. I think you are correct in expecting this
to work and it is not currently supported. I did not realize Spring
would register two or more declarations under the same name for one or
more subtypes.

I am currently not sure how to resolve this, and need to investigate
further. Could you log an issue?

Thanks,
Paul.