Skip to content
Discussion options

You must be logged in to vote

Yet again answering my own question; the problem wasn't in this class but in another class that includes this class as a field. Basically the structure was like this:

Class1:
  private Class2 fieldForClass2;
  getFieldForClass3() { return fieldForClass2.getFieldForClass3; }

Class2:
  private Class3 fieldForClass3;
  get/setFieldForClass3

I was assuming that this error was related to Class2, as the exception seemed to reference the fieldForClass3 field/methods defined in that class.

However, I forgot to add @JsonIgnore to Class1#getFieldForClass3(), so basically Jackson was serializing my Class3 twice; once as part of Class1 and once as part of Class2. When trying to deserialize, Jackson…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@yawkat
Comment options

Answer selected by yawkat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants