SpringCloud多个接口标注@FeignClient报错

报错信息

Caused by: org.springframework.beans.factory.support.BeanDefinitionOverrideException:
 Invalid bean definition with name 'xxx.FeignClientSpecification' defined in null:
  Cannot register bean definition [Generic bean: class [org.springframework.cloud.openfeign.FeignClientSpecification]; 
  ........
  There is already ......

重复加载了bean.

原因

原因:多个类用@feignclient标注同一个服务,出错问题:Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.Caused by: org.springframework.beans.factory.support.Bea..

如果标注了两个或以上类 @FeignClient 标注同一个 服务名称 调用方会主配置类启动会报错

解决方法

解决办法,添加
spring.main.allow-bean-definition-overriding=true
原文地址:https://www.cnblogs.com/hnxbp/p/14962656.html