On Fri, May 15, 2009 at 12:30 PM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:
>
> 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?
>
Paul,
I filed the issue under [hope it's clear enough]:
https://jersey.dev.java.net/issues/show_bug.cgi?id=295
As I commented there, there might be a way to retrieve the specific class
from Spring (without derived classes) or Jersey might have to match only the
top class in the hierarchy.
For now, I managed to accomplish what I wanted using composition over
inheritance (one resource has an instance of the other resource, and
delegates actions to it).
[]'s
Pedro
>
>
> Thanks,
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>
>