美文网首页
Could not read JSON: Cannot cons

Could not read JSON: Cannot cons

作者: 甜甜的老豆 | 来源:发表于2020-02-18 12:10 被阅读0次

    Could not read JSON: Cannot construct instance of `com.example.entity.User` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)\n at [Source: (byte[])\"{\"@class\":\"com.example.entity.User\",\"id\":1,\"userName\":\"hu\",\"passWord\":\"123\",\"realName\":\"chao\"}\"; line: 1, column: 37]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.example.entity.User` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)\n at [Source: (byte[])\"{\"@class\":\"com.example.entity.User\",\"id\":1,\"userName\":\"hu\",\"passWord\":\"123\",\"realName\":\"chao\"}\"; line: 1, column: 37]",


    解决办法:

    在bean里加上无参构造函数

    相关文章

      网友评论

          本文标题:Could not read JSON: Cannot cons

          本文链接:https://www.haomeiwen.com/subject/jmqcfhtx.html