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里加上无参构造函数
![](https://img.haomeiwen.com/i13725913/391dc37ccd4a7d48.png)
网友评论