How to configure cxf:rsServer to use JacksonJsonProvider
Issue
- We tried to configure the
JacksonJsonProviderforcxf:rsServer. However, when we deploy it to Fuse, the system are still using the defaultJSONProvider(based on Jettison).
<cxf:rsServer id="..." address="/..." serviceClass="..." ...>
<cxf:providers>
<bean class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" ></bean>
</cxf:providers>
...
</cxf:rsServer>
- Understand your quickstart project (quickstarts\cxf\rest) gave an example to use
JacksonJsonProviderwithjaxrs:server. May we know how to apply the same tocxf:rsServer?
<jaxrs:server id="customerService" address="/crm">
...
<jaxrs:providers>
<bean class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"></bean>
</jaxrs:providers>
...
</jaxrs:server>
<cxf:bus>
...
<cxf:properties>
<!--
This property needs to be set 'true' in order to give preference to JacksonJsonProvider
over the default Jettison provider.
-->
<entry key="skip.default.json.provider.registration" value="true" ></entry>
</cxf:properties>
</cxf:bus>
Environment
- Red Hat JBoss Fuse
- 6.x
- Apache Camel
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
