
Consider defining a bean of type ‘org.springframework.web.client.RestTemplat
记录下几天敲代码遇到的小问题
Description: Field restTemplate in com.lifly.controller.FreemarkerController required a bean of type 'org.springframework.web.client.RestTemplate' that could not be found. Action: Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.以上错误是说找不到RestTemplate对象,需要在配置文件中配置一下,
@Configuration public class RestTemplateConfig { @Bean public RestTemplate restTemplate(RestTemplateBuilder builder){ return builder.build(); } }这样就好了
👁️ 阅读量:0
© 版权声明:本文《Consider defining a bean of type ‘org.springframework.web.client.RestTemplat》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686554880a290630.html。