admin管理员组文章数量:1571755
使用SpringSecurityOauth2启动异常:
ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘openIdAuthenticationSecurityConfig’: Unsatisfied dependency expressed through field ‘ygerAuthenticationSuccessHandler’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘ygerAuthenticationSuccessHandler’: Unsatisfied dependency expressed through field ‘authorizationServerTokenServices’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerEndpointsConfiguration’: Unsatisfied dependency expressed through field ‘configurers’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘ygerAuthorizationServerConfig’: Unsatisfied dependency expressed through field ‘authenticationManager’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.security.authentication.AuthenticationManager’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2020-12-03 14:54:16.351 INFO 4512 — [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
解决办法:
核心上面已经标记出来,添加一个配置类就好了:
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
/**
* @author liurui
* @date 2019年11月25日
*/
@Configuration
public class ConfigurationUpdateBean extends WebSecurityConfigurerAdapter {
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
}
本文标签:
版权声明:本文标题:Unsatisfied dependency expressed through field ‘authorizationServerTokenServices‘ 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1725805658a1043998.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论