For ‘mall-coupon‘ URL not provided. Will try picking an instance via load-balancing. org.springfram
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': Inject
使用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

解决:
pom文件加入LoadBalancer依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-loadbalancer</artifactId>
<version>3.1.1</version>
</dependency>
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐

所有评论(0)