zoukankan      html  css  js  c++  java
  • bubbo调用Failed to invoke remote method异常解决

    bubbo调用服务异常:

    com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote method: getPlanFlowInfo, provider: dubbo://10.20.30.164:21331/com.ys.mqpms.api.IMqPmsApi?application=ysportal-server&default.check=false&default.timeout=300000&dubbo=2.5.3&interface=com.ys.mqpms.api.IMqPmsApi&methods=.....................

           at com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker.doInvoke(DubboInvoker.java:101)

           at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:144)

             ........................................................

           at java.lang.Thread.run(Thread.java:745)

    Caused by: com.alibaba.dubbo.remoting.RemotingException: message can not send, because channel is closed . url:dubbo://10.20.30.164:21331/com.ys.mqpms.api.IMqPmsApi?application=ysportal-server&codec=dubbo&default.check=false&default.timeout=300000&dubbo=2.5.3&heartbeat=60000&interface=com.ys.mqpms.api.IMqPmsApi&methods=......................................

           at com.alibaba.dubbo.remoting.transport.AbstractClient.send(AbstractClient.java:268)

           at com.alibaba.dubbo.remoting.transport.AbstractPeer.send(AbstractPeer.java:51)

           at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeChannel.request(HeaderExchangeChannel.java:112)

           at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeClient.request(HeaderExchangeClient.java:91)

           at com.alibaba.dubbo.rpc.protocol.dubbo.ReferenceCountExchangeClient.request(ReferenceCountExchangeClient.java:81)

           at com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker.doInvoke(DubboInvoker.java:96)

           ... 74 more

    原因分析

    message can not send, because channel is closed   远程方法调用失败,提示通道被关闭,无法发送信息

    打开dubbo的管理页面:出现此异常是,对应下图服务应该是不存在的.(下图是服务已经提供出去后正确的显示)

    1. 检查服务提供的配置文件是否正确,配置文件是否加载

    dubbo_provider.xml  提供服务的文件

                  <dubbo:service interface="com.ys.xxxx.xxxx.xxxx" ref="xxxxImpl"   version="1.0" />

    bean.xml  加载 dubbo_provider.xml  配置文件

                    <import resource="classpath*:/dubbo_provider.xml" />

    2.检查客户端、服务端的超时配置;如果超时时间没有设置,设置为一个较长时间,就可以了

        <dubbo:consumer check="false" timeout="300000" />
        <dubbo:provider timeout="300000" />

    3.检查你调用服务所在机器ip地址与你调用端配置的ip地址端口是否一致,如下红色url地址

    dubbo_customer.xml  调用服务的配置

       <dubbo:reference id="xxxx" interface="com.ys.xxxx.xxx.xxxxApi" url="dubbo://10.20.30.164:21331" version="1.0"  />

    4.检查发布服务的项目是否启动正常,发布服务的项目没有正常启动也会出现此问题

  • 相关阅读:
    用make编译openCV报错:ts_gtest.cpp:(.text._ZN7testing8internal2RED2Ev+0xf): undefined reference to 'regfreeA'
    Makefile:160: recipe for target 'all' failed (Ubuntu 16.06 + Opencv3.2)解决办法
    Linux常用命令汇总
    深度图像检测算法总结与对比(4)
    深度图像检测算法总结与对比(3)
    深度图像检测算法总结与对比(2)
    深度图像检测算法总结与对比(1)
    Caffe SSD的resize过程解析
    caffe 生成检测框并绘图
    Caffe中deploy.prototxt 和 train_val.prototxt 区别
  • 原文地址:https://www.cnblogs.com/huaixiaonian/p/8359029.html
Copyright © 2011-2022 走看看