Cannot construct instance of - Jackson

后端 未结 5 1795
北恋
北恋 2020-12-01 05:11

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.JsonMappingExcepti         


        
5条回答
  •  庸人自扰
    2020-12-01 05:42

    Your @JsonSubTypes declaration does not make sense: it needs to list implementation (sub-) classes, NOT the class itself (which would be pointless). So you need to modify that entry to list sub-class(es) there are; or use some other mechanism to register sub-classes (SimpleModule has something like addAbstractTypeMapping).

提交回复
热议问题