zoukankan      html  css  js  c++  java
  • 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的反序列化需要无参构造函数,而我在实体类中添加了有参数的构造函数。

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

  • 相关阅读:
    Word Break
    Binary Tree Right Side View
    41. First Missing Positive
    2 Sum ,3 Sum, 3 Sum close
    216. Combination Sum III
    190. Reverse Bits
    143. Reorder List
    142. Linked List Cycle II
    Single Number i,ii,iii
    62. Unique Paths i & ii
  • 原文地址:https://www.cnblogs.com/mingforyou/p/14736177.html
Copyright © 2011-2022 走看看