解决No Feign Client for loadBalancing defined,修改Maven依赖

Spring微服务报错:

java.lang.IllegalStateException: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?

Maven依赖有问题,原来的依赖:

   <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-netflix-eureka-client</artifactId>
        </dependency>

改成:

   <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>

个人遇到的问题在此记录,也希望对您有所帮助。

你可能感兴趣的:(解决方法,maven,java)