Error starting ApplicationContext. To display the conditions report re-run your application with 'de

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-07-25 16:58:54.568 ERROR 67232 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Field restOperations in com.example.api.config.controller.ConfigControllerOne required a bean of type 'org.springframework.web.client.RestOperations' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.web.client.RestOperations' in your configuration.


Process finished with exit code 1

项目启动突然报错,之前一直好好的,怎么会突然报错呢,这是最让人头大的问题,从网上搜了好多说是依赖包重复了删掉即可,但是仔细查看了pom文件也没发现什么异常的地方,首先要定位到是修改了哪个class文件后引起的报错,

如下图所示肉眼观察确实也没有问题,但是依旧报错,然后我删除部分代码重新启动,终于发现是因为

然后我逐步删除部分代码重新启动,终于发现是因为多了行以下接口

@Autowired
private RestOperations restOperations;
这是我第二次碰到的问题了,在此立个flag不能再犯这种错误了!希望大家不要因此疏忽大意,如果你也遇到同样的问题看看是否是这个问题,如果不是这个问题,希望你在解决问题之后在留言区留言分享一下你的问题,谢谢!
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值