
解决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 { // ..... }👁️ 阅读量:0
© 版权声明:本文《解决idea启动报错:Consider defining a bean of type ‘com.service.applicant.Applicant‘ in your configuration.》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686557377a291424.html。