title: Jboss 7.1.1 - Jackson ContextResolver<ObjectMapper> works only on one deployment
body: <p>I have two rest webapps I want to deploy on Jboss 7.1.1. server.</p>
  
  <p>Rest requests in both apps produces and consumes Json. I use jackson provider to serialize and deserialize objects. </p>
  
  <p>Now, I need custom ObjectMapper configurations for each webapp.
  So to resolve this problem I added @Provider classes implementing  ContextResolver. One for each project. Fe. One of my class looks like that:</p>
  
  <pre><code>@provider
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_JSON)
  public class JacksonConfig implements ContextResolver&lt;ObjectMapper&gt; {
     private final ObjectMapper objectMapper;
     public JacksonConfig()
     {
         objectMapper = new ObjectMapper();
         objectMapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
     }
     @Override
     public ObjectMapper getContext(Class&lt;?&gt; objectType) {
         return objectMapper;
     }
  }
  </code></pre>
  
  <p>It works well when I deploy only one of this projects on jboss. When I try to deploy both, only first initialized project use defined objectMapper. Other one never calls getContext method from ContextResolver class. What could I do wrong? </p>
  
  <p>EDIT!:</p>
  
  <p>After a lot of trials I decided to change method of parsing json from jackson to staxon. I hoped at least this method will work well. But not... Serialization works perfectly on both deployed applications. But again, somehow jboss decided to use jackson instead of staxon in deserialization process. Again always application which I call first after deployment works well. But Second one using jackson (no idea why...) which calls exceptions. Always...</p>
  
  <p>Is there any problem with Jboss? Probably I'm just doing something wrong but I have no idea where. Anybody has idea where should I look?</p>