I have resolved JSON recursive loop with @JsonIdentityInfothrough to Baeldung\'s blog1 (Thanks)
@JsonIdentityInfo
But now, another error occurs :
Method threw
Remove toString method.
toString
In case you are using Lombok:
Check you Entity/DAO class you might be using @Data annotation from lombok which by default includes getter and setters. Change it to @Getters and @Setter in case you need those and remove @Data annotation.
@Data
@Getters
@Setter