
关于SpringBoot启动报错Consider defining a bean of type ‘xx.xx.*Service‘ in your configuration.
关于SpringBoot启动报错Consider defining a bean of type 'xx.xx.*Service' in your configuration
- 1、问题详情
- 2、问题解读
- 3、解决方法
提示原意:考虑定义一个类型为’com.cloud.service网站.appfile.AppFiles服务’在你的配置中。
也就是说你交给Spring管理的某个Service bean没有扫描到,导致无法进行实例化。
解决思路是:指定扫描包路径进行加载。
3、解决方法在SpringBoot的启动类中加入@ComponentScan,格式如下所示的代码:
@ComponentScan(basePackages = {"指定的包路径"})实例演示如下:
👁️ 阅读量:0
© 版权声明:本文《关于SpringBoot启动报错Consider defining a bean of type ‘xx.xx.*Service‘ in your configuration.》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686552670a289998.html。