1.原因分析:就是因为导入了下面的jar包,导致无法注入feign接口
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-hystrix</artifactId>
<version>10.7.4</version>
<scope>compile</scope>
</dependency>
2.解决方案,将上述jar包替换为下面的
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
<version>2.2.2.RELEASE</version>
</dependency>
本文分析了Feign接口注入失败的原因,指出是因为引入了feign-hystrix jar包导致的问题。提供了将feign-hystrix替换为spring-cloud-starter-netflix-ribbon的解决方案,以解决Feign与Hystrix之间的冲突。
1554

被折叠的 条评论
为什么被折叠?



