cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julio Carlos Barrera Juez <>
Subject Re: Using Jackson as JSON body reader/writer with DOSGi
Date Mon, 17 Jun 2013 10:19:59 GMT

I'm trying to achieve the same configuration than you, Neil. I'm not using
Spring, but Blueprint. Moreover, I have a multi-bundle configuration. I
have DOSGi that offers REST API of my services published in the OSGi
Service Registry. I have one of these services that needs to be serialized
using JSON instead of XML. Then, I want to use Jackson 2.2.x (FasterXML
Maven group ID, not Codehaus) as JSON provider, but I don't know how to
tell DOSGi using my own JSON provider.

I have tried using DOSGi property "" with value
"com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider", but I get:

"No message body reader has been found for request class ModelObjectA,
ContentType : application/json."

and "415 Unsupported Media Type" in client.

I have tried to declare my JSON provider as a bean in my blueprint, but I
does not work. The problem is that "DOSGi is not declared in any place", it
is an OSGi feature declared as a bundle in my OSGi container. Then, I have
no way to configure it.

What can I do?

Thank you very much.

On 14 June 2013 15:19, Julio Carlos Barrera Juez <> wrote:

> Thank you very much, I will try it on Monday ;-) Have a nice weekend!
> On 14 June 2013 15:17, NCorbet <> wrote:
>> Julio,
>> Here is configuration I added to my spring file to use
>> JacksonJaxbJsonProvider:
>> <bean id="jaxbAnnotationInspector"
>> class="org.codehaus.jackson.xc.JaxbAnnotationIntrospector" />
>> <bean id="jacksonObjectMapper"
>> class="">
>>                 <property name="annotationIntrospector"
>> ref="jaxbAnnotationInspector" />
>> </bean>
>> <bean id="jsonProvider"
>> class="org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider" />
>> You need to set the jaxbAnnotationIntrospector in the ObjectMapper so it
>> forces Jackson to look at JaxB annotations first. This worked well for
>> me...until I needed to Marshall/UnMarshall abstract types. If you are ok
>> with mixing Jackson and Jaxb annotations then this should be no big deal
>> to
>> you ( the abstract type issue that is, the rest worked fine).
>> Hope that helps
>> --
>> View this message in context:
>> Sent from the cxf-user mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message