I am using Jackson and I'm having problems, when I try to deserialize an Object I get the following error:
com.fasterxml.jackson.databind.JsonMappingException:
Can not construct instance of net.MyAbstractClass,
problem: abstract types either need to be mapped to concrete types,
have custom deserializer, or be instantiated with additional type information
I am having problems in the attribute:
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT, property = "@id")
@JsonSubTypes({ @JsonSubTypes.Type(value = MyAbstractClass.class, name = "MyAbstractClass") })
@ManyToOne
private MyAbstractClass object;
Could anyone help me?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…