美文网首页
The bean 'xxx-xxx.FeignClientSpe

The bean 'xxx-xxx.FeignClientSpe

作者: 拄杖忙学轻声码 | 来源:发表于2021-08-26 11:45 被阅读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
    

    相关文章

      网友评论

          本文标题:The bean 'xxx-xxx.FeignClientSpe

          本文链接:https://www.haomeiwen.com/subject/cfidiltx.html