Jboss 7.1.1 - Jackson ContextResolver <ObjectMapper> only works with one deployment
I have two leisure web applications that I want to deploy on Jboss 7.1.1. server.
Rest requests in both applications produce and consume Json. I use the jackson provider to serialize and deserialize objects.
Now I need custom configurations of ObjectMapper for each webapp. Therefore, to solve this problem, I added @Provider classes that implement ContextResolver. One for each project. Fe. One of my classes is as follows:
@provider
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class JacksonConfig implements ContextResolver<ObjectMapper> {
private final ObjectMapper objectMapper;
public JacksonConfig()
{
objectMapper = new ObjectMapper();
objectMapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
}
@Override
public ObjectMapper getContext(Class<?> objectType) {
return objectMapper;
}
}
, jboss. , Mapper. getContext ContextResolver. ?
EDIT:
json jackson staxon. , , , . ... . -, - jboss . , , . -, ( , ...), . ...
Jboss? , - , , . - , ?
+5
1
, . resteasy, :
, web.xml :
<context-param>
<param-name>resteasy.use.deployment.sensitive.factory</param-name>
<param-value>false</param-value>
</context-param>
Restaasy jira. , , jboss resteasy, ...
+4