其他分享
首页 > 其他分享> > Cannot construct instance of `com.**` (although at least one Creator exists)

Cannot construct instance of `com.**` (although at least one Creator exists)

作者:互联网

 

JSON parse error: Cannot construct instance of `com.**` (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.**` (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)
 at [Source: (PushbackInputStream); line: 2, column: 2]]
 

spring boot 的post传递实体类的过程中出现了反向序列化的异常

解决方案
在实体类中添加无参构造函数。

 

原因
jackson的反序列化需要无参构造函数,而我在实体类中添加了有参数的构造函数。

在实体类中添加无参构造函数即可。

标签:实体类,exists,Creator,least,construct,com,构造函数
来源: https://www.cnblogs.com/mingforyou/p/14736177.html