Could not read JSON: Cannot cons

2020-02-18  本文已影响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里加上无参构造函数

上一篇下一篇

猜你喜欢

热点阅读