admin管理员组文章数量:1794759
关于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 = {"指定的包路径"})实例演示如下:
本文标签: 报错beandefiningSpringBootservice
版权声明:本文标题:关于SpringBoot启动报错Consider defining a bean of type ‘xx.xx.*Service‘ in your configuration. 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686552450a81044.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论