栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

【gulimall报错】For ‘gulimall-coupon‘ URL not provided. Will try picking an instance via load-balancing

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【gulimall报错】For ‘gulimall-coupon‘ URL not provided. Will try picking an instance via load-balancing

出现以下报错时For ‘gulimall-coupon’ URL not provided. Will try picking an instance via load-balancing

完整报错:

1-10-12 16:54:54.197  INFO 11276 --- [           main] o.s.c.openfeign.FeignClientFactoryBean   : For 'gulimall-coupon' URL not provided. Will try picking an instance via load-balancing.
2021-10-12 16:54:54.200  WARN 11276 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memberController': Unsatisfied dependency expressed through field 'couponFeignService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.tao.gulimall.member.feign.CouponFeignService': 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?
2021-10-12 16:54:54.202  INFO 11276 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-10-12 16:54:54.214  INFO 11276 --- [           main] ConditionevaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-10-12 16:54:54.241 ERROR 11276 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memberController': Unsatisfied dependency expressed through field 'couponFeignService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.tao.gulimall.member.feign.CouponFeignService': 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?
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.7.jar:5.3.7]
	at org.springframework.beans.factory.annotation.Injectionmetadata.inject(Injectionmetadata.java:119) ~[spring-beans-5.3.7.jar:5.3.7]
从报错的意思可知道,在注册中心中没发现gulimall-coupon这个微服务,有两种大的方向可找出该错误 一、gulimall-coupon这个微服务根本就没注册进去,有以下几种可能
  • 微服务没打开
  • 在注解里面gulimall-coupon名字写错了
二、本身微服务出现问题,自己没注册进nacos,可能是写yml文件时出错,仔细找一下

我自己出错是,调用者的微服务没注册进去,名字写错位置了

修改后

大家写配置文件的时候一定要小心!!

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/322790.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号