title: Jackson Deserialization aborts when sub-property has trailing null value
body: <p>When sending out a JSON to be deserialized by Jackson it seems that if the last value of a subelement is <code>null</code>, Jackson will abort the deserialization.</p>
  
  <hr>
  
  <p><strong>Bad:</strong></p>
  
  <p>If I send this JSON to my receiver (below), the mapped <code>Content</code> object will be <code>null</code>, because the deserialization stops at <code>image</code>:</p>
  
  <pre><code>{"user":{"id":"1", "token":"ABC", "image":null},"content":{"id":"2"}}
  </code></pre>
  
  <p><strong>Good:</strong></p>
  
  <p>If I send it like this, <code>image</code> will still have the <code>null</code> value as desired but the <code>Content</code> object will be created with its id:</p>
  
  <pre><code>{"user":{"id":"1", "image":null, "token":"ABC"},"content":{"id":"2"}}
  </code></pre>
  
  <p>This looks like a bug to me..?!</p>
  
  <hr>
  
  <p><strong>simple Receiver</strong>:</p>
  
  <pre><code>@POST
  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  @Transactional
  public Response create(UserContent source) {
          UserContent dbResult = manager.create(source);
          return Response.status(200)
                  .entity(dbResult.getId().toString()).build();
  }
  </code></pre>
  
  <p><strong>Serializer</strong></p>
  
  <pre><code> public static String objectToString(Object object) {
          ObjectMapper mapper = new ObjectMapper();
          mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"));
  
          Writer strWriter = new StringWriter();
          try {
              mapper.writeValue(strWriter, object);
          } catch (Exception ex) {
              throw new RuntimeException(ex);
          }
          String userDataJSON = strWriter.toString();
  
          return userDataJSON;
      }
  </code></pre>
  
  <p>Can I set up my ObjectMapper to serialize all <code>null</code> as <code>""</code> or empty Object on my sending side?</p>
  
  <p>If I pass a <code>UserContent</code> object with a <code>null</code> property to the above method, the resulting JSON will have <code>null</code> values like the example above and should the last item of a list have the value null, deserialization will abort causing NullPointerExceptions in my backend.</p>
  
  <hr>
  
  <p>edit - the UserContent class:</p>
  
  <pre><code>@Entity
  @Table(name = "user_content")
  @XmlRootElement
  public class UserContent extends org.springframework.data.jpa.domain.AbstractPersistable&lt;Long&gt; {
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = "user_id", nullable = false)
      @Fetch(FetchMode.JOIN)
      private User user;
  
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = "content_post_id", nullable = false)
      @Fetch(FetchMode.JOIN)
      private Contentcontent;
  
      // more properties...
  }
  </code></pre>
  
  <p>our dependencies:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;jersey-version&gt;1.14&lt;/jersey-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;1.9.5&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
          &lt;version&gt;${jersey-version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
          &lt;version&gt;${jersey-version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-json&lt;/artifactId&gt;
          &lt;version&gt;${jersey-version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey.contribs&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-multipart&lt;/artifactId&gt;
          &lt;version&gt;${jersey-version}&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey.jersey-test-framework&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-test-framework-grizzly2&lt;/artifactId&gt;
          &lt;version&gt;${jersey-version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-servlet&lt;/artifactId&gt;
          &lt;version&gt;${jersey-version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>