title: SpringBoot: Failing at serialize Integer class
body: <p>there is a problem in serialization in a list of objects of a class that has an Integer attribute.</p>
  
  <p>The exception is:</p>
  
  <pre><code>Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: (was java.lang.NullPointerException) (through reference chain: java.util.ArrayList[0]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: java.util.ArrayList[0])
  </code></pre>
  
  <p>The class is: <strong><em>Discipline.java</em></strong></p>
  
  <pre><code>public class Discipline extends AbstractModel {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      private String name;
  
      private String course;
  
      private Integer teoricLoad;
  
      private Integer exerciseLoad;
  
      private Integer labLoad;
  
      // Ignored getters and setters
  }
  </code></pre>
  
  <p>I checked the objects and the list of disciplines arent null just the Integer attributes.</p>