I have an interesting problem in that my Wildfly 8.1 installation is using Jackson (not Jackson 2) for marshalling classes to JSON. I would like to use Jettison in order to take advantage of the JAXB annotations I have in my classes.
To force the server to use Jettison instead of Jackson, I've performed the following steps :
Modified the POM.xml dependencies to depend on the resteasy-jettison-provider module with the scope set as provided
< dependency >
< groupId >org.jboss.resteasy</ groupId >
< artifactId >resteasy-jettison-provider</ artifactId > < version >3.0.8.Final</ version >
< scope >provided</ scope >
</ dependency >Modified the jboss-deployment-structure.xml in my WEB-INF directory to include the jettison module and exclude all jackson modules:
< jboss-deployment-structure >
< deployment >
< exclusions >
< module name="org.jboss.resteasy.resteasy-jackson-provider" />
< module name="com.fasterxml.jackson.core.jackson-core" />
< module name="com.fasterxml.jackson.core.jackson-annotations" />
< module name="com.fasterxml.jackson.core.jackson-databind" />
< module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
< module name="org.jboss.resteasy.resteasy-jackson2-provider" />
</ exclusions >
< dependencies >
< module name="org.jboss.resteasy.resteasy-jettison-provider" />
</ dependencies >
</ deployment >
</ jboss-deployment-structure >
When I start the server, I send a simple bit of JSON to log into my application:
{
"authRequest":
{
"appLogin":"restful",
"appPassword":"mypassword"
}
}
However, I get the following exception from the server when I send this code snippet:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "authRequest" (class com.myapp.AppAuthRequest), not marked as ignorable
From that exception, it looks like Jackson is still being used, despite my configuration.
Can anyone point out what I'm doing wrong or what misconfiguration I have?