• 那是从何处传来的钟声呢?偶尔听到那钟声,平添一份喜悦与向往之情。

Spring Cloud @FeignClient 同一个服务注册两次

后端 Nanait 3年前 (2021-04-12) 1061次浏览 已收录 0个评论 扫描二维码

问题描述:1.多个接口上的@FeignClient(“相同服务名”)会报错,overriding is disabled。

2.复制过去的类,再启动也会报错。

使用的版本 SpringBoot: 2.1.4.RELEASE,SpringCloud: Greenwich.SR1,OpenFeign: 2.1.1.RELEASE

The bean 'eureka-provider.FeignClientSpecification', defined in null, could not be registered. 
A bean with that name has already been defined in null and overriding is disabled.

解决办法 1:
在 application.yml 中添加

spring:
  main:
    allow-bean-definition-overriding: true

解决办法 2:
http://cloud.spring.io/spring-cloud-static/Edgware.SR2/single/spring-cloud.html#_creating_feign_clients_manually

参考连接:

  1. https://blog.csdn.net/u012211603/article/details/84312709
  2. https://blog.csdn.net/neosmith/article/details/82349449
  3. https://www.jianshu.com/p/16a526379e8f

 


何处钟 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Spring Cloud @FeignClient 同一个服务注册两次
喜欢 (3)
[15211539367@163.com]
分享 (0)

您必须 登录 才能发表评论!