Infinite Recursion with Jackson JSON and Hibernate JPA issue

前端 未结 25 3127
你的背包
你的背包 2020-11-21 07:31

When trying to convert a JPA object that has a bi-directional association into JSON, I keep getting

org.codehaus.jackson.map.JsonMappingException: Infinite          


        
相关标签:
25条回答
  • 2020-11-21 07:56

    If you cannot ignore the property, try modifying the visibility of the field. In our case, we had old code still submitting entities with the relationship, so in my case, this was the fix:

        @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
        private Trainee trainee;
    
    0 讨论(0)
提交回复
热议问题