This is actually a problem with the Jackson implementation.  The JAX-RS 
specification states that the JAX-RS runtime must pick a Provider 
constructor with the greatest number of parameters.  The problem is, 
Resteasy does not know how to resolve and inject the parameters of the 
Jackson provider constructor with the most parameters.

I'm changing the implementation so that it won't pick constructors with 
parameters that don't have a @Context implemention.  Meanwhile, you'll 
have to instantiate the provider yourself, or Subclass the jackson one 
and register that.

On 10/24/11 7:03 PM, Joe Littlejohn wrote:
> I guess you're experiencing this problem:
>
> http://www.mkyong.com/webservices/jax-rs/illegal-to-inject-a-message-body-into-a-singleton-into-public-org-codehaus-jackson-jaxrs-jacksonjsonprovider/
> https://issues.jboss.org/browse/RESTEASY-503
>
> Bill, maybe it's worth adding your suggested workaround to RESTEASY-503?
>
>
> On 24 October 2011 18:40,<for...@paaro.com>  wrote:
>> Then it works, but then the JacksonJsonProvider implementation is used, but
>> I want JacksonJaxbJsonProvider implementation.
>>
>> On Mon, Oct 24, 2011 at 16:58, Bill Burke<bbu...@redhat.com>  wrote:
>>>
>>> Does it work if you *don't* add jackson provider.jar to your web-inf/lib?
>>>   It comes packaged with AS7 already.
>>>
>>> On 10/24/11 10:30 AM, for...@paaro.com wrote:
>>>>
>>>> Yes, of course:
>>>> sample.war/WEB-INF/lib/resteasy-jackson-provider-2.2.2.GA.jar
>>>>
>>>> On Mon, Oct 24, 2011 at 16:20, Bill Burke<bbu...@redhat.com
>>>> <mailto:bbu...@redhat.com>>  wrote:
>>>>
>>>>     So you added jackson provider .jar to your WEB-INF/lib?
>>>>
>>>>     On 10/24/11 9:26 AM, for...@paaro.com<mailto:for...@paaro.com>  wrote:
>>>>      >  I used this archetype to generate a sample project:
>>>>      >
>>>>      >
>>>>
>>>>   https://docs.jboss.org/author/display/AS7/Creating+your+own+application
>>>>      >
>>>>      >  I have JBoss AS 7.0.1. The example works well (as you can see, no
>>>>      >  web.xml is used). But when trying to add resteasy jackson
>>>>     provider, the
>>>>      >  aforementioned problems appear. Any clues?
>>>>      >
>>>>      >  Thanks!
>>>>      >
>>>>      >  On Mon, Oct 24, 2011 at 14:56, Bill Burke<bbu...@redhat.com
>>>>     <mailto:bbu...@redhat.com>
>>>>      >  <mailto:bbu...@redhat.com<mailto:bbu...@redhat.com>>>  wrote:
>>>>      >
>>>>      >       How can I reproduce the problem?  What app server?  What does
>>>>     your
>>>>      >       web.xml look like?
>>>>      >
>>>>      >       Thanks
>>>>      >
>>>>      >
>>>>      >
>>>>      >
>>>>
>>>>   
>>>> ------------------------------------------------------------------------------
>>>>      >  The demand for IT networking professionals continues to grow, and
>>>> the
>>>>      >  demand for specialized networking skills is growing even more
>>>>     rapidly.
>>>>      >  Take a complimentary Learning@Cisco Self-Assessment and learn
>>>>      >  about Cisco certifications, training, and career opportunities.
>>>>      >  http://p.sf.net/sfu/cisco-dev2dev
>>>>      >
>>>>      >
>>>>      >
>>>>      >  _______________________________________________
>>>>      >  Resteasy-users mailing list
>>>>      >  Resteasy-users@lists.sourceforge.net
>>>>     <mailto:Resteasy-users@lists.sourceforge.net>
>>>>      >  https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>>>
>>>>     --
>>>>     Bill Burke
>>>>     JBoss, a division of Red Hat
>>>>     http://bill.burkecentral.com
>>>>
>>>>
>>>>   
>>>> ------------------------------------------------------------------------------
>>>>     The demand for IT networking professionals continues to grow, and the
>>>>     demand for specialized networking skills is growing even more rapidly.
>>>>     Take a complimentary Learning@Cisco Self-Assessment and learn
>>>>     about Cisco certifications, training, and career opportunities.
>>>>     http://p.sf.net/sfu/cisco-dev2dev
>>>>     _______________________________________________
>>>>     Resteasy-users mailing list
>>>>     Resteasy-users@lists.sourceforge.net
>>>>     <mailto:Resteasy-users@lists.sourceforge.net>
>>>>     https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>>>
>>>>
>>>
>>> --
>>> Bill Burke
>>> JBoss, a division of Red Hat
>>> http://bill.burkecentral.com
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> The demand for IT networking professionals continues to grow, and the
>> demand for specialized networking skills is growing even more rapidly.
>> Take a complimentary Learning@Cisco Self-Assessment and learn
>> about Cisco certifications, training, and career opportunities.
>> http://p.sf.net/sfu/cisco-dev2dev
>> _______________________________________________
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>
>>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to