Caused by: java.lang.NoSuchFieldError: NEVER_RETRY
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'feignRetryer' defined in org.springframework.cloud.netflix.feign.FeignClientsConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [feign.Retryer]: Factory method 'feignRetryer' threw exception; nested exception is java.lang.NoSuchFieldError: NEVER_RETRY
解决方法:
我出现这个错误是我两次引进了下面依赖,也就是导入包重复,所以出现这种错误也可能是有重复不同版本的包。
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
<version>1.1.5.RELEASE</version></dependency>
还有一种可能是使用spring-cloud-dependencies版本不兼容,我使用Dalston.SR1就报错,改成Brixton.SR5即可
<dependency
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR5</version>
<type>pom</type>
<scope>import</scope>
</dependency>