面向bug编程

***************************
APPLICATION FAILED TO START
***************************
Description:
Field articleConfigService in com.heima.article.controller.ApArticleConfigController required a bean of type 
articleConfigService 字段在ApArticleConfigController 需要一个ArticleConfigService类型的bean但是不能找到
'com.heima.article.service.ArticleConfigService' that could not be found.
The injection point has the following annotations:
	 @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.heima.article.service.ArticleConfigService' in your configuration.
考虑定义一个ArticleConfigService这样的bean在你的配置中

首先我们根据第一个提示去查看ApArticleConfigController
在这里插入图片描述
我们发现已经加注解自动注入了
我们点击进入ArticleConfigService中
在这里插入图片描述
问题已经出现了,spring容器中的bean都是实例,然而这个确实一个接口,接口不能实例化只能找一个类来实现它。
在这里插入图片描述
我们进入实现类看看问题所在

在这里插入图片描述
发现虽然名义上当作实现类但是并没有进行实现
解决:
把接口上的注解给去掉,然后让上面的实现类实现这个接口即可
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值