You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2011/11/02 16:51:46 UTC

Turning on Jackson mapping for JSON results

"No message body writer has been found for response class HashSet."

I'm sure I'm supposed to know how to do this, but I can't find it. Do
I need to add a provider?

Re: Turning on Jackson mapping for JSON results

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Benson
On 02/11/11 17:48, Benson Margulies wrote:
> It turns out that I had failed to enable the provider altogether.
>
>   I was trying to use the META-INF stuff instead of:
>
>   sf.setProvider(new JacksonJsonProvider());
>

How does the signature look like ? Is it Set<SomeBean> that is returned 
with SomeBean having no JAXB annotations ? Just curious why default 
Jettison provider did not accept it in isReadable

Sergey

>
>
> On Wed, Nov 2, 2011 at 12:33 PM, Sergey Beryozkin<sb...@gmail.com>  wrote:
>> Hi
>>
>> On 02/11/11 15:51, Benson Margulies wrote:
>>>
>>> "No message body writer has been found for response class HashSet."
>>>
>>> I'm sure I'm supposed to know how to do this, but I can't find it. Do
>>> I need to add a provider?
>>
>> I think Jackson is too strict, I recall a quality patch was submitted to CXF
>> to make sure Jackson can read explicit collections and I think a similar
>> patch needs to be applied to the writeTo side, I'll get back to you a bit
>> later on today
>>
>> Sergey
>>


Re: Turning on Jackson mapping for JSON results

Posted by Benson Margulies <bi...@gmail.com>.
It turns out that I had failed to enable the provider altogether.

 I was trying to use the META-INF stuff instead of:

 sf.setProvider(new JacksonJsonProvider());



On Wed, Nov 2, 2011 at 12:33 PM, Sergey Beryozkin <sb...@gmail.com> wrote:
> Hi
>
> On 02/11/11 15:51, Benson Margulies wrote:
>>
>> "No message body writer has been found for response class HashSet."
>>
>> I'm sure I'm supposed to know how to do this, but I can't find it. Do
>> I need to add a provider?
>
> I think Jackson is too strict, I recall a quality patch was submitted to CXF
> to make sure Jackson can read explicit collections and I think a similar
> patch needs to be applied to the writeTo side, I'll get back to you a bit
> later on today
>
> Sergey
>

Re: Turning on Jackson mapping for JSON results

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On 02/11/11 15:51, Benson Margulies wrote:
> "No message body writer has been found for response class HashSet."
>
> I'm sure I'm supposed to know how to do this, but I can't find it. Do
> I need to add a provider?

I think Jackson is too strict, I recall a quality patch was submitted to 
CXF to make sure Jackson can read explicit collections and I think a 
similar patch needs to be applied to the writeTo side, I'll get back to 
you a bit later on today

Sergey