
解决:Consider defining a bean of type ‘org.springframework.web.client.RestTemplate‘ in your
*************************** APPLICATION FAILED TO START ***************************
Description:
Field restTemplate in com.tanhua.sso.service.HuanXinTokenService required a bean of type 'org.springframework.web.client.RestTemplate' 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 'org.springframework.web.client.RestTemplate' in your configuration.
解决方案:
创建一个Config类:
@Configuration public class Config { @Bean public RestTemplate restTemplate(RestTemplateBuilder builder){ return builder.build(); } }
👁️ 阅读量:0
© 版权声明:本文《解决:Consider defining a bean of type ‘org.springframework.web.client.RestTemplate‘ in your》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686554614a290560.html。