如何解决component required a bean of type ‘org.springframework.web.client.RestTempla

在启动类上文件类上加上下面代码即可

@Bean
  public RestTemplate restTemplate() {
    return new RestTemplate();
  }
	public static void main(String[] args) {
        SpringApplication.run(SakApplication.class, args);
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

版权声明:本文为nyasm原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。