kry0_0.
JCHJava Community | Help. Code. Learn.
•Created by kry0_0. on 10/19/2024 in #java-help
Need help with @JsonManagedReference and @JsonBackReference
I was getting a Multiple back-reference properties with name 'defaultReference' error for my entities so I implemented ("cartitem-excursions") which fixed the issue but created these new ones. I cant figure out what I'm doing wrong can someone help me setting up my @JsonManagedReference and @JsonBackReference for entities.
Entities: https://pastebin.com/p4LCFER8
Errors:
2024-10-18T21:23:27.202-07:00 WARN 20716 --- [nio-8080-exec-5] .c.j.MappingJackson2HttpMessageConverter : Failed to evaluate Jackson deserialization for type [[simple type, class com.assessment.entities.Customers]]: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot handle managed/back reference 'cartitem-excursions': back reference type (java.util.Set<com.assessment.entities.CartItems>) not compatible with managed type (com.assessment.entities.CartItems)
2024-10-18T21:23:27.228-07:00 WARN 20716 --- [nio-8080-exec-5] .c.j.MappingJackson2HttpMessageConverter : Failed to evaluate Jackson deserialization for type [[simple type, class com.assessment.entities.Customers]]: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot handle managed/back reference 'cartitem-excursions': back reference type (java.util.Set<com.assessment.entities.CartItems>) not compatible with managed type (com.assessment.entities.CartItems)
5 replies