users@jersey.java.net

[Jersey] Re: Twitter4j & Jersey: WebApplicationException

From: Martin Matula <martin.matula_at_oracle.com>
Date: Tue, 08 Mar 2011 15:17:50 +0100

Right, Jersey uses media types to find the right
MessageBodyReader/Writter implementation. Seems you are using
application/octet-stream in your case - so there is no way how Jersey
could guess what you are actually trying is to produce json. If you want
to produce json, you have to attach @Produces("application/json") to
your resource method.
Martin

On 8.3.2011 14:57, mahan_h wrote:
> Petr Jurák wrote:
>> Hi,
>> you can try POJO mapping.
>> Add this to your web.xml to Jersey servlet:
>>
>> com.sun.jersey.api.json.POJOMappingFeature
>> true
>>
>> Hope this helps.
>> Regards,
>> Petr
>>
> I added that in my web.xml but I get the very same error.
> I read about this feature in Jersey tutorial. do I need to add @Produces or
> sth. like that to make it work?
>
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/Twitter4j-Jersey-WebApplicationException-tp6095973p6125425.html
> Sent from the Jersey mailing list archive at Nabble.com.