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 :
I think this issue occurs only when you serialize for the first time an Exchange entity. Maybe Jackson save a "copy" of attributes for each Object ?
To prevent infinite loop, you added this annotation :
@JsonIgnoreProperties(value = {"exchange"})
@OneToMany(mappedBy = "exchange")
private List halfFlows;
So, my guess is Jackson "blacklist" property exchange of Halfflow bean.
Workaround : Use an ObjectMapper for each entity on your controller :
ObjectMapper mapper = new ObjectMapper();
@RequestMapping(method = RequestMethod.POST)
public ResponseEntity save(@RequestBody String json) throws JsonParseException, JsonMappingException, IOException {
HalfFlow node = mapper.readValue(json, HalfFlow.class);
HalfFlow halfflow = mapper.convertValue(node, HalfFlow.class);