JsonException No _valueDeserializer assigned

前端 未结 2 1249
Happy的楠姐
Happy的楠姐 2021-01-06 05:00

I\'ve a classic spring web app with some spring crud repository.

I\'m trying to save my entities within a classic angular form and i\'m getting randomly this error :

2条回答
  •  庸人自扰
    2021-01-06 05:57

    As Alex said, to prevent the infinite recursion, you added this annotation

    @JsonIgnoreProperties(value = {"exchange"})
    @OneToMany(mappedBy = "exchange")
    private List halfFlows;
    

    So I actually solved this issue by adding the following to the annotation

    @JsonIgnoreProperties(value = {"exchange"}, allowSetters = true)
    @OneToMany(mappedBy = "exchange")
    private List halfFlows;
    

    This solution is better explained here https://softwareengineering.stackexchange.com/questions/300115/best-way-to-deal-with-hibernate-1-many-relationship-over-rest-json-service

提交回复
热议问题