问题出现:springcloud架构中配置消费者服务后启动时报错
问题描述:
A component required a bean of type ‘org.springframework.web.client.RestTemplate’ that could not be found.
问题截图:

出现原因:
在 Spring Boot 1.3版本中,会默认提供一个RestTemplate的实例Bean,而在 Spring Boot 1.4以及以后的版本中,这个默认的bean不再提供了,我们需要在Application启动时,手动创建一个RestTemplate的配置。
解决方法:
在启动类中添加该实例:

 @BeanRestTemplate restTemplate(){return new RestTemplate();}

参考博文:相关问题具体描述

问题及解决方法记录:A component required a bean of type ‘org.springframework.web.client.RestTemplate‘ that cou相关推荐

  1. 学习记录报错Consider defining a bean of type ‘org.springframework.web.client.RestTemplate‘ in your configu

    springboot启动就报错 信息如下 Field restTemplate in com.atguigu.springcloud.controller.OrderController requir ...

  2. 解决:A component required a bean of type ‘javax.jms.Queue‘ that could not be found.

    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1. 情景描述:只是想简单写个 ActiveMQ 的小样,启动服务却报错: Error starti ...

  3. A component required a bean of type ‘XXX‘ that could not be found 解决办法

    springboot应用启动的时候,bean的加载扫描失败,错误信息如下A component required a bean of type 'XXX' that could not be foun ...

  4. 【已解决】A component required a bean of type ‘XXService‘ that could not found

    一.问题 使用了Mybatis generator自动生成的bean和mapper 写完service层和controller层后运行报错A component required a bean of ...

  5. A component required a bean of type ‘com.lw.mapper.StudentMapper‘ that could not be found.

    当我们用springboot整合mybatis时,发生以下错误 Description:A component required a bean of type 'com.lw.mapper.Stude ...

  6. 【A component required a bean of type ‘‘ that could not be found】

    A component required a bean of type 'cn.gson.oasys.model.dao.managework.mappers.MwDetailsMapper' tha ...

  7. SpringBoot中service注入失败 出现A component required a bean of type 'com.czxy.changgou3.mapper.OrderGoodsMa

    错误信息 Error starting ApplicationContext. To display the conditions report re-run your application wit ...

  8. 调用不同模块A component required a bean of type ‘com.qhzx.td.service.OtcPurchaseSellOutManageService‘ that

    springboot应用启动的时候,bean的加载扫描失败,错误信息如下A component required a bean of type 'XXX' that could not be foun ...

  9. A component required a bean of type ‘com.wyh.service.XXX‘ that could not be found.

    A component required a bean of type 'XXXService' that could not be found 组件需要找不到"Service"类 ...

  10. springboot 配置RedisTemplate 报:Field redisTemplate in XXX required a bean of type 'org.springframework

    错误信息如下: Error starting ApplicationContext. To display the conditions report re-run your application ...

最新文章

  1. python语言怎么学-如何学习Python,以及新手如何入门?
  2. RAC 的一些概念性和原理性的知识
  3. GPU与CPU版本的矩阵乘法对比
  4. 解决express video 手机无法播放的问题
  5. 菜鸟要做架构师——java性能优化之for循环
  6. python 实现统计ftp服务器指定目录下文件夹数目、文件数目及所有文件大小 本次主要为满足应用方核对上传到ftp服务器的文件是否缺漏。 主要要求:指定目录下,文件夹数目/文件数目/所有文件大小
  7. 天天有毒_鸡汤文案类小程序源码
  8. 阿里云服务器 ECS 部署lamp:centos+apache+mysql+php安装配置方法 (centos7)
  9. Vue学习笔记之14-Vue-CLI脚手架
  10. python datetime strptime_python datetime模块strptime/strptime format常见格式命令_施罗德_新浪博客...
  11. vb mysql登录界面_VB\数据库--模拟系统登录界面
  12. 维纳滤波python 函数_Python中离焦图像的维纳滤波
  13. 聊聊游戏本推荐排行榜 这一款竟成黑马
  14. 【SQL数据库】数据库的创建、查询、插入等操作使用方法(结合黑皮书教材网站(db-book中的例子)在MySQL Workbench和shell中实现查询操作
  15. BodyContent揭秘及定制复杂的JSP标签
  16. Jetpack Compose中的Modifier
  17. 第四十二篇:Flink面试方案设计篇
  18. java调用excel在页面生成饼状图_Java 在 Excel 中创建饼图/环形图
  19. 一文看懂-ElasticSearch全文搜索引擎
  20. 信用卡分期利率陷阱——实际利率计算

热门文章

  1. vivox9系统基于Android,vivo X9
  2. 吟清明之诗,舒心中之怀(转)
  3. 动态控制水晶报表中数字栏位的值显示的小数位数
  4. matlab画gds图,Matlab GDS流程.doc
  5. UVM中starting_phase
  6. python-百分号字符串拼接
  7. python如何设置窗口为活动窗口
  8. java随机生成三位数
  9. 网页视频进度条禁止拖动----解决
  10. 电子厂里撂了挑子,我默默自学起了Android|2021年中总结