码上敲享录 > java常见报错解答 > Caused by: java.lang.NoSuchFieldError: NEVER_RETRY已解决

Caused by: java.lang.NoSuchFieldError: NEVER_RETRY已解决

上一章章节目录下一章 2018-09-23已有8272人阅读 评论(0)

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>

本文链接:http://www.yayihouse.com/yayishuwu/chapter/1603

向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交