JPA @ManyToMany java.lang.StackOverflowError: null [How to Solve]

Not much to say, go directly to the code entity

1.permission

2.role

The key point is to rewrite hashcode and equals in the role,   ToString method

Remove the annotation @data, change it to @getter and setter annotations, and solve the error

Read More: