错误描述:
Description:
Field restTemplate in com.tky.bim.basedata.service.impl.RelationV1Update 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.
描述说没有找到restTemplate,说明restTemplate没有注入到spring容器中去,我们需要手动把它注入进来,在启动类上注入
/**
* @Description: 手动注入RestTemplate
*
* <p>启动报错:找不到RestTemplate
*
* @auther: zpq
* @date: 2020/11/5 4:13 下午
*/
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
这样再重新启动就可以了。