【错误:A component required a bean of type ‘xxx‘ that could not be found.解决办法】

向右看齐 2023-09-26 22:22 250阅读 0赞

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

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

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

00b4b0847af3445a885347d66fdcae63.png

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

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

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

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

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

发表评论

表情:
评论列表 (有 0 条评论,250人围观)

还没有评论,来说两句吧...

相关阅读