I have resolved JSON recursive loop with @JsonIdentityInfothrough to Baeldung\'s blog1 (Thanks)
But now, another error occurs :
Method threw
Well, my guess is that Registration.toString() prints the string representation of each payment in the list, and since Payment.toString() includes the string representation of Registration, Registration.toString() is called again, which in turn calls Payment.toString() again, and so on.
Try to return an empty string in Payment.toString() to see if the problem goes away.