{"id":893,"date":"2023-03-11T06:52:00","date_gmt":"2023-03-10T22:52:00","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=893"},"modified":"2023-04-29T16:36:34","modified_gmt":"2023-04-29T08:36:34","slug":"spring-cloud-feign-error-xx-feignclientspecification-defined-in-null-could-not-be-registered","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/11\/spring-cloud-feign-error-xx-feignclientspecification-defined-in-null-could-not-be-registered\/","title":{"rendered":"Spring Cloud Feign\u62a5\u9519&#8217;xx.FeignClientSpecification&#8217;, defined in null, could not be registered"},"content":{"rendered":"<h2>\u9519\u8bef\u63cf\u8ff0<\/h2>\n<p>\u7248\u672c\u4f7f\u7528\u7684\u662f\uff1a<\/p>\n<ul>\n<li>SpringBoot: 2.1.3.RELEASE<\/li>\n<li>SpringCloud: Greenwich.SR1<\/li>\n<li>OpenFeign: 2.1.0.M2<\/li>\n<\/ul>\n<p><!-- more --><\/p>\n<p>\u62a5\u9519\uff1a<\/p>\n<pre><code>The bean &#039;xxxx.FeignClientSpecification&#039;, defined in null, could not be registered. \nA bean with that name has already been defined in null and overriding is disabled.\n\nCaused by: org.springframework.beans.factory.support.BeanDefinitionOverrideException: \nInvalid bean definition with name xxxx.FeignClientSpecification&#039; defined in null: \nCannot register bean definition [Generic bean: class [org.springframework.cloud.openfeign.FeignClientSpecification]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean &#039;xxxx.FeignClientSpecification&#039;: There is already [Generic bean: class [org.springframework.cloud.openfeign.FeignClientSpecification]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound.<\/code><\/pre>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<p>\u591a\u4e2a\u63a5\u53e3\u4e0a\u7684<code>@FeignClient(&quot;\u76f8\u540c\u670d\u52a1\u540d&quot;)<\/code>\u4f1a\u62a5\u9519\uff0c<code>A bean with that name has already been defined in null and overriding is disabled.<\/code><\/p>\n<p>\u5728application.yml\u4e2d\u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-yml\">spring:\n  main:\n    allow-bean-definition-overriding: true<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9519\u8bef\u63cf\u8ff0 \u7248\u672c\u4f7f\u7528\u7684\u662f\uff1a SpringBoot: 2.1.3.RELEASE SpringCloud: Gre [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42],"tags":[251],"class_list":["post-893","post","type-post","status-publish","format-standard","hentry","category-spring-cloud","tag-feign"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=893"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/893\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}