项目场景:A component required a bean of type ’ ’ that could not be found.
Bean找不到
问题描述
添加SpringSecurity框架的情况下,SpringBoot启动时,Bean找不到
***************************
APPLICATION FAILED TO START
***************************
Description:
A component required a bean of type 'xxx' that could not be found.
Action:
Consider defining a bean of type 'xxx' in your configuration.
与目标 VM 断开连接, 地址为: ''127.0.0.1:1819',传输: '套接字''
进程已结束,退出代码1
原因分析:
没有添加注解@Component
解决方案:
在xxx类上,添加@Component注解