【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文件时出错,仔细找一下

我自己出错是,调用者的微服务没注册进去,名字写错位置了
在这里插入图片描述
修改后
在这里插入图片描述

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

  • 10
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值