admin管理员组

文章数量:1794759

解决:Consider defining a bean of type ‘org.springframework.web.client.RestTemplate‘ in your

解决: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(); } }

 

本文标签: typeorgdefiningbeanClient