feign 跨服务调用出错

Blade 未结 2 1764
1010602131
1010602131 剑圣 2021-05-28 11:53

一、该问题的重现步骤是什么?

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

image.png

五、若有更多详细信息,请在下面提供。

2条回答
  • 2021-05-28 11:57

    postman是正常的

    image.png

    回答: 2021-05-29 09:40

    上面有把错误信息打印出来了,就是死活走的是fackback,但是postman却正常访问

    回答: 2021-05-29 09:43

    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

    回答: 2021-05-29 11:01

    image.png

    回答: 2021-05-29 11:01

    image.png


    回答: 2021-05-29 11:04

    说是 serverName 找不到 , 配置了 spring.cloud.nacos.discovery.service  还是调用feign 报错



    0 讨论(0)
  • 2021-05-28 21:11

    你是所有的feign调用都报错还是只有你写的这个报错?如果所有都报错那就是工程本身没有依赖完整,如果只有自己写的报错需要把你的代码贴出来,否则无法判断

    0 讨论(0)
提交回复