问题及解决方法记录:A component required a bean of type ‘org.springframework.web.client.RestTemplate‘ that cou
问题出现: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相关推荐
- 学习记录报错Consider defining a bean of type ‘org.springframework.web.client.RestTemplate‘ in your configu
springboot启动就报错 信息如下 Field restTemplate in com.atguigu.springcloud.controller.OrderController requir ...
- 解决:A component required a bean of type ‘javax.jms.Queue‘ that could not be found.
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1. 情景描述:只是想简单写个 ActiveMQ 的小样,启动服务却报错: Error starti ...
- 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 ...
- 【已解决】A component required a bean of type ‘XXService‘ that could not found
一.问题 使用了Mybatis generator自动生成的bean和mapper 写完service层和controller层后运行报错A component required a bean of ...
- 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 ...
- 【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 ...
- 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 ...
- 调用不同模块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 ...
- 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"类 ...
- 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 ...
最新文章
- python语言怎么学-如何学习Python,以及新手如何入门?
- RAC 的一些概念性和原理性的知识
- GPU与CPU版本的矩阵乘法对比
- 解决express video 手机无法播放的问题
- 菜鸟要做架构师——java性能优化之for循环
- python 实现统计ftp服务器指定目录下文件夹数目、文件数目及所有文件大小 本次主要为满足应用方核对上传到ftp服务器的文件是否缺漏。 主要要求:指定目录下,文件夹数目/文件数目/所有文件大小
- 天天有毒_鸡汤文案类小程序源码
- 阿里云服务器 ECS 部署lamp:centos+apache+mysql+php安装配置方法 (centos7)
- Vue学习笔记之14-Vue-CLI脚手架
- python datetime strptime_python datetime模块strptime/strptime format常见格式命令_施罗德_新浪博客...
- vb mysql登录界面_VB\数据库--模拟系统登录界面
- 维纳滤波python 函数_Python中离焦图像的维纳滤波
- 聊聊游戏本推荐排行榜 这一款竟成黑马
- 【SQL数据库】数据库的创建、查询、插入等操作使用方法(结合黑皮书教材网站(db-book中的例子)在MySQL Workbench和shell中实现查询操作
- BodyContent揭秘及定制复杂的JSP标签
- Jetpack Compose中的Modifier
- 第四十二篇:Flink面试方案设计篇
- java调用excel在页面生成饼状图_Java 在 Excel 中创建饼图/环形图
- 一文看懂-ElasticSearch全文搜索引擎
- 信用卡分期利率陷阱——实际利率计算