users@jersey.java.net

[Jersey] Re: Need help with weird error with jersey and jackson

From: Saroj Kumar <sarojk_at_gmail.com>
Date: Sat, 3 Nov 2012 15:55:42 -0700

Thanks everyone for their input

Yes, we are using Jettison for JSON Conversion. We will explore upgrade and
hopefully the problem will go away

-Saroj


On Fri, Oct 26, 2012 at 6:04 AM, Glen Mazza <gmazza_at_talend.com> wrote:

> As the other poster said, you're using a painfully old version of
> Jersey, it's up to 1.14 now, with probably countless bugs fixed between
> that and the 1.1.5 you're using. Again, running mvn dependency:tree
> (providing you're Mavenized) should indicate whether Jackson or Jettison is
> being used, and further, you should be able to switch to the other to see
> if that will fix things using the instructions & samples linked to below.
> But I would first focus on an upgrade to 1.14.
>
> Glen
>
>
> On 10/25/2012 06:50 PM, Saroj Kumar wrote:
>
> Thanks Glen for your inputs
>
> Problem is random. I have not been able to reproduce it consistently.
> Sometimes, we get this error but not all the time.
>
> We are using JAXB for converting Java objects into JSON. I don't know if
> jaxb support will use Jackson or Jettison/
>
> Our web.xml is like this
>
> <servlet>
> <servlet-name>Jersey Spring Web Application</servlet-name>
>
> <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
>
> <init-param>
>
> <param-name>com.sun.ws.rest.config.property.resourceConfigClass</param-name>
>
> <param-value>com.sun.ws.rest.api.core.PackagesResourceConfig</param-value>
> </init-param>
> <load-on-startup>2</load-on-startup>
> </servlet>
>
> Please advise.
>
> Thanks
> Saroj
>
> On Thu, Oct 25, 2012 at 1:50 PM, Glen Mazza <gmazza_at_talend.com> wrote:
>
>> This is looking for a needle in a haystack, it would be good if you
>> could shrink the query to the minimum that consistently reproduces the
>> problem. No, Jersey uses either Jettison or Jackson depending on how you
>> configure it (
>> http://jersey.java.net/nonav/documentation/latest/user-guide.html#json).
>> mvn dependency:tree should let you know if you're using Jackson (if you
>> don't see Jackson you're not), also the jacksonjsonprovider sample (
>> http://www.jroller.com/gmazza/entry/jersey_samples_on_cxf) shows how you
>> can switch to Jackson, maybe the problem will go away then.
>>
>> Glen
>>
>>
>> On 10/25/2012 04:36 PM, Saroj Kumar wrote:
>>
>> Hi There
>>
>>
>> We are using Jersey 1.1.5 and finding that jersey is returning a JSON
>> response which is valid most of the times but, there are sometime when we
>> are getting an extra “}” which makes it an invalid json response.
>>
>>
>>
>> I understand Jersey’s json support is based on Jackson library. Can you
>> please point me in the right direction?
>>
>>
>>
>> I am attaching samples of good and bad json, with this email.
>>
>>
>> Please advise.
>>
>>
>> Thanks in advance.
>>
>>
>>
>> -Saroj
>>
>>
>>
>> --
>> Glen Mazza
>> Talend Community Coders - coders.talend.com
>> blog: www.jroller.com/gmazza
>>
>>
>
>
> --
> Glen Mazza
> Talend Community Coders - coders.talend.com
> blog: www.jroller.com/gmazza
>
>