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

本文记录了一次SpringBoot项目启动失败的经历,详细介绍了错误信息、原因分析及解决方法。问题在于控制器依赖的服务Bean未被正确注册,通过在服务实现类上添加@Service注解解决了该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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<ChongyInsuInfo, ChongyInsuInfoFilter> implements ChongyInsuInfoService {......}




评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值