当前位置: 代码迷 >> 综合 >> Feign报错“The bean 'xxx.FeignClientSpecification', defined in null,could not be registered”
  详细解决方案

Feign报错“The bean 'xxx.FeignClientSpecification', defined in null,could not be registered”

热度:76   发布时间:2023-12-16 06:06:26.0

SpringCloud整合Feign报错:

Description:

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

 

原因:

在多个接口上定义@FeignClient(name = 相同的名字),有相同名字的Feign注册会导致重复注册。

 

解决办法:

方法一:

在application.yml中配置:

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

 

方法二:

将定义@FeignClient(name = 相同的名字)的所有接口整合成一个接口。

  相关解决方案