org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memberController': Unsatisfied dependency expressed through field 'memberCoupons'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.mall.piaopiaomall.member.feign.MemberCoupons': 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?
利用feign远程调用,启动项目是出现上面错误
是因为没有配置spring-cloud-starter-loadbalancer依赖
在pom.xml文件中加入依赖即可
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-loadbalancer</artifactId>
</dependency>
本文解决了一个关于使用Feign进行远程调用时遇到的配置问题,具体表现为未正确配置spring-cloud-starter-loadbalancer导致项目启动失败。文中详细介绍了如何通过在pom.xml文件中添加必要的依赖来解决该问题。
872

被折叠的 条评论
为什么被折叠?



