users@jersey.java.net

[Jersey] Re: Jersey hangs when invalid JSON is sent in POST request

From: nbaliga <nbaliga_at_cleartrial.com>
Date: Mon, 28 Mar 2011 11:49:08 -0700 (PDT)

I've had to switch over to using Jackson as the JSON processor by registering
a custom JAXBContextResolver and using JSONConfiguration.natural().

This wasn't documented too well, btw. It was only after looking at the
source code was it clear that:
natural = Jackson and mapped = internal JSON parser.

As a result I have to also find all classes/representations that I want to
have processed by this custom ContextResolver. Fortunately using Spring's
ClassPathScanningCandidateComponentProvider made this process easy.
Otherwise remembering to modify the ContextResolver after adding/deleting a
representation would've been awkward and a deal breaker.

I'm really surprised that:
1) a pretty basic test case such as sending incorrectly formed JSON causes
Jersey to hang.
2) there's no easy way to switch over to using Jackson without having to go
through the custom ContextResolver exercise.

I think I'm missing something obvious here. Would be great if the community
would comment on this issue. Any thoughts anyone?

--
View this message in context: http://jersey.576304.n2.nabble.com/Jersey-hangs-when-invalid-JSON-is-sent-in-POST-request-tp6205397p6216287.html
Sent from the Jersey mailing list archive at Nabble.com.