1

I have tried CustomJSONSerializer from Suppress wrapper object when serializing Java object into JSON using Jackson.

But getting following exception:

com.fasterxml.jackson.databind.JsonMappingException: object is not an instance of declaring class (through reference chain: com.fasterxml.jackson.databind.type.SimpleType["test"])
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:232)
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:197)
at com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:183)

I want to serialize entity Like

Entity A

Entity A.Parent

Entity A.Parent.Parent

Community
  • 1
  • 1
Navneet
  • 121
  • 2
  • 11

1 Answers1

0

I got this error too when switching from jackson 2.1.5 to 2.2.0 (or 2.2.1), try downgrading jackson to 2.1.5? Assume it's due to stricter checks in 2.2, but haven't figured out yet how to correct it.

Stefan L
  • 1,529
  • 13
  • 20