A component required a bean of type ‘xxx‘ that could not be found.

原因:spring boot注入失败

解决:

1.springboot扫描的范围是与启动类同级别的包

2.若在同一模块,检查是否加上了IOC注解

3.若不在同一模块,在启动类加上包扫描 @ComponentScan("xxx")

猜你喜欢

转载自blog.csdn.net/qq_59384418/article/details/130160149