spring data jpa 双向绑定关系的一个错误 Cannot call sendError() after the response has been committed
上图
在团队列表中进行了关系绑定 团队用户
在查询时报错
这是双向关系的一个问题,因为它们互相引用,在反序列化时,Jackson在无限循环中运行
建议是增加@JsonIgnore
关系的一端。
问题解决
如果这解决了问题,您可以查看@ JsonManagedReference / @ JsonBackReference和@JsonIdentityInfo。
https://www.toptal.com/javascript/bidirectional-relationship-in-json