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

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 = 相同的名字)的所有接口整合成一个接口。

你可能感兴趣的:(Feign,SpringCloud)