zoukankan      html  css  js  c++  java
  • 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
    
  • 相关阅读:
    C语言01
    C++面试总结更新
    Python网络爬虫与信息提取02
    Self-Driving Car 01
    Python网络爬虫与信息提取01
    Python-03
    Shell
    Python-05
    Python-04
    Python-02
  • 原文地址:https://www.cnblogs.com/hnxbp/p/14962656.html
Copyright © 2011-2022 走看看