SpringBoot 提示: Cannot construct instance of `*` (no Creators, like default construct, exist)

SpringBoot 提示:Cannot construct instance of  com.digipower.sercurity.entity.JwtUserDetails (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator) at [Source: (org.apache.catalina.connector.CoyoteInputStream);

原因:

原因是我在该实体类(JwtUserDetails.java)中添加了一个为了方便实例化该类用的构造函数,导致JVM不会添加默认的无参构造函数,而jackson的反序列化需要无参构造函数,因此报错。

解决办法:

我在该实体类(JwtUserDetails.java)中添加了一个无参构造函数,问题解决。

猜你喜欢

转载自blog.csdn.net/zhouzhiwengang/article/details/112566565