admin管理员组文章数量:1794759
解决idea启动报错:Consider defining a bean of type ‘com.service.applicant.Applicant‘ in your configuration.
idea在启动时,报错:报错日志为
*************************** APPLICATION FAILED TO START *************************** Description: Parameter 0 of method setApplicant in webService.controller.RequestController required a bean of type 'com.service.applicant.Applicant' that could not be found. Action: Consider defining a bean of type 'com.service.applicant.Applicant' in your configuration. 解决方法在启动类上面加上如下注解,添加的内容视具体是哪一个bean而定
@SpringBootApplication // 添加没有扫描到的bean的路径 @ComponentScan({"com.service"}) // 如果引入的包不是本项目的,那么还需要再加一行扫描自己项目的bean @ComponentScan({"com.abc"}) public class WebServiceApplication { // ..... }版权声明:本文标题:解决idea启动报错:Consider defining a bean of type ‘com.service.applicant.Applicant‘ in your configuration. 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686557159a81595.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论