users@jersey.java.net

Re: [Jersey] no error message displayed on json deserialization failure during POST

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 17 Mar 2010 12:03:26 +0100

Hi Shankar,

Is it possible to send me the server log?

Also can you enable server-side request/response logging as i would
like to see what is sent to and what returned from Jersey?

   https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/LoggingFilter.html


What do you mean by "Jersey 1.1.4 with jsersey 1.1.5"? is there a typo?

Plus what do you mean when you say "throws mapping exception when i
explicitly get the body POSTed as String and then use
mapper.readValue"? is this referring to flex client side?

Paul.

On Mar 17, 2010, at 11:48 AM, Shankar K wrote:

> if there is a problem during de-serialization of JSON body(POST) the
> resulting ERROR isn't logged. I have pasted below the method which
> accepts the POST request. I'm using a Flex Client which has been
> throwing infamous Error #2032: Stream whenever I POST and my server
> never had any error message logged indicating the problem. After
> going in different directions to solve it (mostly in the flex side)
> realized that it was due to issues during deserialization ( throws
> mapping exception when i explicitly get the body POSTed as String
> and then use mapper.readValue).
>
> Am i missing something to see these logs? Btw, I get other ERROR
> logs from jersey such as this -- 16:07:21,304 ERROR [STDERR] Mar 17,
> 2010 4:07:21 PM
> com.sun.jersey.server.impl.application.WebApplicationImpl initiate
>
> @POST
> @Consumes("application/json")
> @Produces("application/json")
> public String postUser(User body) throws Exception{
>
> return body.getGivenName();
>
> }
>
> I'm using Jersey 1.1.4 with jsersey 1.1.5 and jackson 1.4.3.
>
> Appreciate your response!!
>