'feign.FeignContext' that could not be found
在Spring Cloud Zuul中加入Feign,报如下错误:
A component required a bean of type ‘org.springframework.cloud.netflix.feign.FeignContext’ that could not be found.
- Bean method ‘feignContext’ not loaded because @ConditionalOnClass did not find required class ‘feign.Feign’
从以下两个方面Check:
I.在pom文件中引入下面的jar:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
</dependency>
II. 在启动类main方法上加入Feign注解:
@EnableFeignClients
还没有评论,来说两句吧...