Consider defining a bean of type 'com.taikang.service.ChongyGameInfoService' in your configuration.

springboot 项目启动遇到的问题:

(1)错误描述:

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.

[ ERROR] [2017-09-08 14:18:34:034] org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter [42] [main]- 


***************************
APPLICATION FAILED TO START
***************************

Description:

Field chongyGameInfoService in com.taikang.controller.ChongyGameInfoController required a bean of type 'com.taikang.service.ChongyGameInfoService' that could not be found.

Action:

Consider defining a bean of type 'com.taikang.service.ChongyGameInfoService' in your configuration.


(2)原因分析:

     提示扫描不到service层的bean,建议创建一个bean,然后发现使用注解开发时,service层忘记注入bean了

(3)解决方法

   在serviceimpl层加上@Service注解

如代码所示:

@Service
public class ChongyInsuInfoServiceImpl extends BaseServiceImpl implements ChongyInsuInfoService {......}




你可能感兴趣的:(java,报错案例)