title: Java Spring HttpMessageNotWritableException/JsonMappingException with Hibernate FetchType.LAZY in Jackson serialization process
body: <p>I use <code>Java</code> <code>Spring</code> web controller And <code>jackson</code> for parsing  responses. Also I have four <code>Java</code> <code>Hibernate</code> entities: <code>User</code> <code>Filter</code> <code>Make</code> <code>Model</code>, with bidirectional relation in Make -> Model(s): </p>
  
  <blockquote>
    <p>GeUser.getFilters().get(0).getModel().getMake().getModels().get(0).getMake()...</p>
  </blockquote>
  
  <p>I tried add <code>@JsonIgnoreProperties(value = "models")</code> in <code>Model</code> class but still get exception:</p>
  
  <pre><code>WARNING: Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: com.gecars.objects.GeUser["filters"]-&gt;org.hibernate.collection.internal.PersistentSet[0]-&gt;com.gecars.objects.Filter["model"]-&gt;com.gecars.objects.models.Model_$$_jvste81_2["handler"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: com.gecars.objects.GeUser["filters"]-&gt;org.hibernate.collection.internal.PersistentSet[0]-&gt;com.gecars.objects.Filter["model"]-&gt;com.gecars.objects.models.Model_$$_jvste81_2["handler"])
  </code></pre>
  
  <p>Entities GeUser:</p>
  
  <pre><code>@Entity
  @Table(name="users")
  public class GeUser {
  ...
    @OneToMany(fetch = FetchType.LAZY)
    private Set&lt;Filter&gt; filters = new HashSet&lt;Filter&gt;(0);
  ..
  </code></pre>
  
  <p>Filter:</p>
  
  <pre><code>@Entity
  @Table(name="filters")
  public class Filter {
  ...
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "fk_model") 
    private Model model;
  ..
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>@Entity
  @Table(name="models")
  public class Model {
  ...
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "fk_make") 
    @JsonIgnoreProperties(value = "models") //Not working (if I correct understand it should tell jackson to skip models from Make class )
    private Make make;
  ... 
  </code></pre>
  
  <p>Make:</p>
  
  <pre><code>@Entity
  @Table(name="auto")
  public class Make {
  ....
     @OneToMany(fetch = FetchType.LAZY, mappedBy = "make")
     @JsonIgnoreProperties(value = "make")
     private List&lt;Model&gt; models = new ArrayList&lt;Model&gt;(0);
  ...
  </code></pre>