I\'m working on an EclipseLink project in which one user can \"follow\" another as can be done on social media sites. I have this set up with a User
entity (referen
Every time you have @OneToMany
(a collection) you need to add @JsonIgnore
to it or else it will cause an infinite loop which results in a stack overflow exception because it keeps looking up between the parent(the one side) and the child (the many side)
For more info on dealing with this kind of problems check this excellent article http://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion