创建了一个实现 AuthenticationSuccessHandler
的类,并添加了 @Component
守护进程以将其与 Spring Security 配置对象相关联。
https://zapodaj.net/b3085e4c1cd43.png.html
@Component
public class CustomAuthenticationSuccessHandler implements AuthenticationSuccessHandler {..}
IntelliJ 向我展示了一条消息
Could not autowire. No beans of 'CustomAuthenticationSuccessHandler' type found
最佳答案
Intellij 并不总能解决 Autowiring 问题,即使应用程序运行良好。
如果它运行良好并且您没有遇到编译错误,请忽略它。
尝试运行重建项目
来修复它。
您也可以将包列表添加到组件扫描
@ComponentScan(basePackages = { "com.a.b", "com.a.c" })
关于java - 无法 Autowiring 。找不到 bean 'here name' 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45491592/