认证授权中解决AuthenticationManager无法注入问题
认证授权中AuthenticationManager无法注入
在启动springboot项目时,提示AuthenticationManager无法注入问题

报如下错误
Description:
Field authenticationManager in com.security.uaa.config.AuthorizationServer required a bean of type 'org.springframework.security.authentication.AuthenticationManager' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
解决方法
在继承 WebSecurityConfigurerAdapter 的类中配置

代码:
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
RocketMq同组消费者如何自动设置InstanceName
这篇文章主要介绍了RocketMq同组消费者如何自动设置InstanceName问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教2024-06-06
Springboot第三方jar打不进jar里的问题分析及解决
文章介绍了如何解决在Maven项目中无法从maven仓库找到的第三方jar包问题,通过将这些jar包添加到本地库,使用特定的命令设置groupId、artifactId、版本号、包类型和文件路径,此方法适用于在Windows环境下的操作,并需要安装Maven环境变量2025-10-10
SpringBoot中application.yml基本配置解读
文章主要介绍了Spring Boot项目中`application.properties`和`application.yml`配置文件的使用方法和区别,包括优先级、配置文件所在目录、端口服务配置、数据库配置、多profile配置以及静态资源路径的指定2024-12-12
JAVA基础 语句标签的合法使用,以及{}语句块到底有什么用?
以前的一个思维误区,for(){},if(){}之类的用法中,逻辑if()和语句块{}应该是相互独立的两种语法2012-08-08


最新评论