天天看點

Feign遠端調用報錯(The bean ‘course-service.FeignClientSpecification‘ could not be registered)已解決

spring boot項目啟動失敗

問題描述:學生服務調用課程服務,我在學生服務寫了兩個Feign接口,分别調用課程服務中的兩個controller 中的功能,因為寫了兩次調用course-service,(A bean with that name has already been defined and overriding is disabled:已經定義了具有該名稱的bean,并且禁用了重寫)。

啟動學生服務發現起不了

Feign遠端調用報錯(The bean ‘course-service.FeignClientSpecification‘ could not be registered)已解決

控制台報錯

第一行:描述了已經定義了具有該名稱的bean,并且禁用了重寫。

Feign遠端調用報錯(The bean ‘course-service.FeignClientSpecification‘ could not be registered)已解決

 action:官方提示方法解決:spring.main.allow-bean-definition-overriding=true