9
The JacksonJsonProvider is not working with CXF.
CXF v2.6.0 Jackson v2.1.2 (com.fasterxml.jackson) RESTClient (for testing)
I do have the provider configured like below in beans.xml.
<bean id="jacksonMapper" class="com.fasterxml.jackson.databind.ObjectMapper">
<property name="dateFormat">
<bean class="java.text.SimpleDateFormat">
<constructor-arg type="java.lang.String" value="yyyy-MM-dd'T'HH:mm:ss.SSSZ"> </constructor-arg>
</bean>
</property>
</bean>
<bean id="jacksonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider">
<property name="mapper" ref="jacksonMapper" />
</bean>
in jaxrs:server.....>
<jaxrs:providers>
<ref bean="jaxbProvider" />
<ref bean="jacksonProvider" />
</jaxrs:providers>
</jaxrs:server>
The application gets deployed without any issues, it gives good JSON while I give the request as "application/xml" and the response as "application/json".
When I try to give JSON in request by setting Content-Type=application/json I'm facing the 500 Internal Server Error
The request is getting logged in the log file thru CXF-logging.
The request is not at all landing in the service implementation class of my webservice.
The JSON in request body is :
{"SearchOrdersRequest":{"LoginCredentials":{"AppId":"BookStore","Username":"myuser","Password":"abcd1234","SecurityToken":"Vcvx45YilzX1"},"SearchHeader":{"SearchCategory":"Rep","FilterLogic":"1 AND 2","SearchParams":{"Field":"Order Number (s)","Operator":"EQUALS","Values":"600045335"}}}}
Any immediate help is appreciated.