The bean 'xxx-xxx.FeignClientSpe

2021-08-26  本文已影响0人  拄杖忙学轻声码

启动springboot项目,控制台报如下错误:
Description:
The bean 'xxx-xxx.FeignClientSpecification', defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled.


image.png

解决办法:
此错误是因为spring容器中存在相同名称的bean对象,在yml配置文件中配置代码
main:
allow-bean-definition-overriding: true
覆盖相同名称的bean即可:

spring:
  application:
    name: xxx-xxx-service
  main:
    allow-bean-definition-overriding: true  # 后来发现的bean会覆盖之前相同名称的bean
上一篇 下一篇

猜你喜欢

热点阅读