Spring Cloud Consumer端Feign注入報錯

報錯信息以下:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderInfoController': Unsatisfied dependency expressed through field 'baseFeign'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.sinoeve.ctm.orderconsumer.Feign.BaseFeign': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-netflix-ribbon?
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASEjava

 

界面沒有明顯提示錯誤,因此只能先把目標放在pom配置文件。果不其然是POM配置問題spring

此處引入錯誤正確應該是express

<dependency>    <groupId>org.springframework.cloud</groupId>    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency>
相關文章
相關標籤/搜索