Julio Carlos Barrera Juez
2013-06-14 07:58:17 UTC
I want to serialize my REST Requests and Responses in JSON. I want to use
FasterXML Jackson [1] to perform this task. I'm using DOSGi 2.7.4 and
Jackson 2.2.3-SNAPSHOT. My model objects are JAXB annotated and my REST WS
is declared like this:
...
@Path("/foo")
@GET
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public ModelObjectB foo(ModelObjectA ModelObjectA);
...
I register it as an OSGi service using DOSGi
property "org.apache.cxf.rs.provider" with value
"com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider".
But when I call the WS, I get:
"No message body reader has been found for request class ModelObjectA,
ContentType : application/json."
What am I missing?
Moreover, it is possible to configure JacksonJaxbJsonProvider, or do I need
to extend the class with a custom configured class?
Thank you!
[1] FasterXML Jackson - http://wiki.fasterxml.com/JacksonHome
FasterXML Jackson [1] to perform this task. I'm using DOSGi 2.7.4 and
Jackson 2.2.3-SNAPSHOT. My model objects are JAXB annotated and my REST WS
is declared like this:
...
@Path("/foo")
@GET
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public ModelObjectB foo(ModelObjectA ModelObjectA);
...
I register it as an OSGi service using DOSGi
property "org.apache.cxf.rs.provider" with value
"com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider".
But when I call the WS, I get:
"No message body reader has been found for request class ModelObjectA,
ContentType : application/json."
What am I missing?
Moreover, it is possible to configure JacksonJaxbJsonProvider, or do I need
to extend the class with a custom configured class?
Thank you!
[1] FasterXML Jackson - http://wiki.fasterxml.com/JacksonHome