feign 跨服务调用出错

Blade 未结 2 1765
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条回答
  •  1010602131
    1010602131 (楼主)
    2021-05-28 11:57

    postman是正常的

    image.png

    回答: 2021-05-28 11:57

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

    回答: 2021-05-28 11:57

    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-28 11:57

    image.png

    回答: 2021-05-28 11:57

    image.png


    回答: 2021-05-28 11:57

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



提交回复