I have resolved JSON recursive loop with @JsonIdentityInfo
through to Baeldung\'s blog1 (Thanks)
But now, another error occurs :
Method threw
in your Registration.toString()
you are calling a Payment.toString()
and on your Payment.toString()
you are calling Registration.toString()
You have created a loop in toString
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("payment", payment) //<----------- REMOVE THIS
.toString();
}
or
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("registration", registration) //<----------- REMOVE THIS
.toString();
}
Or better... remove both