Could not read JSON: Cannot construct instance of `com.example.entity.User` (no Creators, like de...

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 construct instance of `com.example.entity.User` (no Creators, like de...)