title: Jackson not ignoring null values
body: <p>Here is my object  </p>
  
  <pre><code>public class TokenTO {
      private String clientId;
      private String clientSecret;
      private String authCode;
      private String authToken;
      ....
  }
  </code></pre>
  
  <p>and when I get the <code>JSON</code> response I see  </p>
  
  <pre><code>{"clientId":null,"clientSecret":null,"authCode":null,"authToken":"312301658396979836978200915715157679015:80bf41c2-bc97-492f-a65e-172bef9efb7c:922000000"} 
  </code></pre>
  
  <p>My <code>JacksonContextResolver</code> looks like  </p>
  
  <pre><code>public JacksonContextResolver() {
          objectMapper = new ObjectMapper()
                  .setSerializationInclusion(JsonSerialize.Inclusion.ALWAYS);
  
          final AnnotationIntrospector annotationIntrospector = new JaxbAnnotationIntrospector();
          objectMapper
                  .enable(DeserializationConfig.Feature.READ_ENUMS_USING_TO_STRING)
                  .setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL)
                  .setDeserializationConfig(objectMapper.getDeserializationConfig().withAnnotationIntrospector(annotationIntrospector))
                  .setSerializationConfig(objectMapper.getSerializationConfig().withAnnotationIntrospector(annotationIntrospector));
      }  
  </code></pre>
  
  <p>I tried answers in  <a href="https://stackoverflow.com/questions/11757487/how-to-tell-jackson-to-ignore-a-field-during-serialization-if-its-value-is-null">How to tell Jackson to ignore a field during serialization if its value is null?</a> and <a href="https://stackoverflow.com/questions/16089651/jackson-ignore-empty-values-or-null">jackson ignore empty values (or null)</a> but none of them work.  </p>
  
  <p>My <code>maven</code> dependencies look like  </p>
  
  <pre><code> &lt;properties&gt;
       &lt;jaxrs-api.version&gt;3.0.8.Final&lt;/jaxrs-api.version&gt;
       &lt;maven-war-plugin.version&gt;2.4&lt;/maven-war-plugin.version&gt;
       &lt;resteasy-jaxrs.version&gt;3.0.9.Final&lt;/resteasy-jaxrs.version&gt;
       &lt;jackson.version&gt;1.9.13&lt;/jackson.version&gt;
      &lt;jaxrs-api.version&gt;3.0.8.Final&lt;/jaxrs-api.version&gt;
   &lt;/properties&gt;
   &lt;dependency&gt;
      &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
      &lt;version&gt;${jackson.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-core-asl&lt;/artifactId&gt;
      &lt;version&gt;${jackson.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-xc&lt;/artifactId&gt;
      &lt;version&gt;${jackson.version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>Question</strong>  </p>
  
  <p>How do I get rid of <code>null</code> values in <code>JSON</code>?</p>