Skip to main content

Solution: No qualifying bean of type ‘org.springframework.web.client.RestTemplate‘ available:

An error occurs when the SpringBoot project is started:

 No qualifying bean of type 'org.springframework.web.client.RestTemplate' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

Reason : Due to the springboot version issue, the current project version needs to be managed by the spring container.

problem solved :

Add the following code to the project startup class:

@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
}