一、该问题的重现步骤是什么?
1. 通过 postman 调用 feign提供者能正常访问
2. 通过程序调用 feign 报错
3.
二、你期待的结果是什么?实际看到的又是什么?
期待 正常返回数据
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
bladex2.8.1 centos8
四、请提供详细的错误堆栈信息,这很重要。
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'retryableRibbonLoadBalancingHttpClient' defined in org.springframework.cloud.netflix.ribbon.apache.HttpClientRibbonConfiguration: Unsatisfied dependency expressed through method 'retryableRibbonLoadBalancingHttpClient' parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ribbonLoadBalancer' defined in org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.loadbalancer.ILoadBalancer]: Factory method 'ribbonLoadBalancer' threw exception; nested exception is java.lang.IllegalStateException: Can not get service instances from nacos, serviceId=null
五、若有更多详细信息,请在下面提供。
postman是正常的
上面有把错误信息打印出来了,就是死活走的是fackback,但是postman却正常访问
Error creating bean with name 'retryableRibbonLoadBalancingHttpClient' defined in org.springframework.cloud.netflix.ribbon.apache.HttpClientRibbonConfiguration: Unsatisfied dependency expressed through method 'retryableRibbonLoadBalancingHttpClient' parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ribbonLoadBalancer' defined in org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.loadbalancer.ILoadBalancer]: Factory method 'ribbonLoadBalancer' threw exception; nested exception is java.lang.IllegalStateException: Can not get service instances from nacos, serviceId=null
说是 serverName 找不到 , 配置了 spring.cloud.nacos.discovery.service 还是调用feign 报错
扫一扫访问 Blade技术社区 移动端