> 文章列表 > 【A component required a bean of type ‘xxx‘ that could not be found.】

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

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

在学谷粒商城项目的时候出现了以下问题:

***************************

APPLICATION FAILED TO START

***************************

Description:

A component required a bean of type 'org.redisson.Redisson' that could not be found.

Action:

Consider defining a bean of type 'org.redisson.Redisson' in your configuration.

Process finished with exit code 1

组件需要一个类型为“org.redison.redisson”的bean,但找不到该bean。

原因:springboot启动时没扫描到我写的配置类

解决办法在Application启动类上添加注解

@ComponentScan(basePackages = {"类所在的包名"})

参考文章:A component required a bean of type ‘XXX‘ that could not be found 解决办法_进阶的蚂蚱的博客-CSDN博客