Cannot construct instance of - Jackson

后端 未结 5 1799
北恋
北恋 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:46

    You cannot instantiate an abstract class, Jackson neither. You should give Jackson information on how to instantiate MyAbstractClass with a concrete type.

    See this answer on stackoverflow: Jackson JSON library: how to instantiate a class that contains abstract fields

    And maybe also see Jackson Polymorphic Deserialization

提交回复
热议问题