SpringBoot入门到精通-JwtUser` (no Creators, like default construct, exist): cannot deserialize from Objec

[ERROR] 2020-07-09 19:19:18,057 [http-nio-8889-exec-15] c.c.c.e.BusinessExceptionHandler - [192.168.60.80]:[/]:[/woportalapi/cuuser/auth/userinfo GET] org.springframework.security.authentication.InternalAuthenticationServiceException: Could not read JSON: Cannot construct instance of `com.信息n.security.user.JwtUser` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
 at [Source: (byte[])"{"@class":"co1.11.security.user.JwtUser","username":"11","authorities":["java.util.ArrayList",[]]}"; line: 1, column: 49]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.1on.security.user.JwtUser` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
 at [Source: (byte[])"{"@class":"co1.common.security.user.JwtUser","username":"11","authorities":["java.util.ArrayList",[]]}"; line: 1, column: 49]
        at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:123)
        at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:144)
        at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:175)
        at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:200)
        at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter$AuthenticationManagerDelegator.authenticate(WebSecurityConfigurerAdapter.java:503)
        at com.1n.ztauth.impl.AuthServiceImpl.login(AuthServiceImpl.java:77)
        at com1n.ztauth.UserAuth2Controller.loginAccessToken(UserAuth2Controller.java:97)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

因为JwtUser中没有 无构造函数

添加后即可

private JwtUser(){
    // empty Constructor
}

你可能感兴趣的:(SpringBoot入门到精通-JwtUser` (no Creators, like default construct, exist): cannot deserialize from Objec)