JSON response:
{
"categories": [{
"id": "1",
"category": "category1"
Brate, slusaj... I had the same problem. I was building a simple Restful service and JAXB was returning JSON from my JaxB annotated POJO class when GET methods were executed quite well. When my methds were @Consuming JSON (POST, PUT cases) I found out that JAXB had some problems there.
It's better to use JACKSON instead JaxB annotations (you'll find a lot about it googling) when buiilding Jersey / JSON service. The thing is that JAXB doesn't do well the conversion (deserialization) from JSON to your POJO objects. JAXB with its @XMLRootElement is quite suitable when working with XML, but not JSON.
This is what I have in web.xml to enable Jackson's deserialization/serialization of JSON:
<!-- JAXB works great with XML but with JSON it's much better to use Jackson. Jersey will use Jackson -->
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>
Google for .jar file that needs to be included for Jersey to use Jackson... Good luck...