title: Spring MVC - JSON infinite recursion
body: <p>I have bi-directional relationship like this...</p>
  
  <p>Person.java</p>
  
  <pre><code> public class Person{
  
      @JsonIgnore
      @OneToMany(targetEntity=PersonOrganization.class, cascade=CascadeType.ALL,
          fetch=FetchType.EAGER, mappedBy="person")
      private Set&lt;PeopleOrg&gt; organization;
      .....
   }
  </code></pre>
  
  <p>PersonOrganization.java</p>
  
  <pre><code>  public class PersonOrganization{
  
      @JsonIgnore
  @ManyToOne(fetch=FetchType.LAZY)
  @JoinColumn(name="PERSONID", nullable=false)
  private Person person;
    }
  </code></pre>
  
  <p>Even with <code>@JsonIgnore</code> annotation I am getting infinite recursion error when trying to retrieve Person records. I have tried new annotations in 1.6 version. <code>@JsonBackReference</code> and <code>@JsonManagedReference</code>. Even then I am getting infinite recursion.. </p>
  
  <p>With <code>@JsonBackReference("person-organization")</code> on <code>Person</code> and <code>@JsonManagedReference("person-organization")</code> on <code>PersonOrganization</code></p>
  
  <pre><code>org.codehaus.jackson.map.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: com.entity.Person["organization"]-&gt;org.hibernate.collection.PersistentSet[0]-&gt;com.entity.PersonOrganization["person"]-&gt;com.entity.Person["organization"]-&gt;org.hibernate.collection.PersistentSet[0]...
  </code></pre>
  
  <p>Even If I interchange the annotations, I am still getting this exception.. Please let me know if there is something wrong with the mappings or the way I am using JSON annotations. Thanks</p>