无法内省类org.springframework.cloud.netflix.ribbon.RestClientRibbonConfiguration上的带注释的方法

时间:2019-06-10 17:50:04

标签: netflix-eureka

以在Eureka Server上注册的名称调用一项服务时出错。如果我缺少某些依赖关系或我在代码中需要做的任何事情,任何人都可以帮忙。

我尝试在Pom.xml中添加Ribbon依赖项,但这没有帮助

public class ConsumerClient {

    @Autowired
    RestTemplate restTemplate;

    @RequestMapping("/employee")
    public Employee getEmployee() {

        String baseUrl = "http://producer-service/employee";
        return restTemplate.getForObject(baseUrl, Employee.class);
    }

完全错误-

There was an unexpected error (type=Internal Server Error, status=500).
Failed to process import candidates for configuration class [org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.cloud.netflix.ribbon.RestClientRibbonConfiguration

0 个答案:

没有答案