For ‘mall-coupon‘ URL not provided. Will try picking an instance via load-balancing. org.springfram

  • 使用openfeign服务调用时报错:
  • 原因:最新版`OpenFeign`不包含`LoadBalancer`
  • 解决:

使用openfeign服务调用时报错:

For 'mall-coupon' URL not provided. Will try picking an instance via load-balancing.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'umsMemberController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.biienu.mallshop.member.feign.CouponAll': Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalancer?


原因:最新版OpenFeign不包含LoadBalancer

For ‘mall-coupon‘ URL not provided. Will try picking an instance via load-balancing. org.springfram_第1张图片

解决:

pom文件加入LoadBalancer依赖:


    org.springframework.cloud
    spring-cloud-loadbalancer
    3.1.1

你可能感兴趣的:(bug记录,java,spring,spring,cloud,OpenFeign,Feign)