Caused by: com.alibaba.dubbo.remoting.RemotingException: message can not send, because channel is closed . url:dubbo://192.168.199.170:20883/com.coracle.dms.service.DmsChannelContactsService?anyhost=true&application=xweb-consumer&check=false&codec=dubbo&default.delay=-1&default.payload=56562838&default.retries=0&default.timeout=600000&delay=-1&dubbo=2.5.3&heartbeat=60000&interface=com.coracle.dms.service.DmsChannelContactsService&loadbalance=leastactive&methods=getUserIdsByChannelIds,queryContactByUserId,updateByIdsSelective,selectForListPage,insertSelective,updateByPrimaryKeySelective,update,insert,createAccount,selectByPrimaryKey,selectByCondition,updateByPrimaryKey,create,deleteByPrimaryKey,detail&pid=7796®ister=true&revision=1.0.0&side=consumer×tamp=1540885272633&version=server.dms.chenz
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)
at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:144)
at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:74)
at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:53)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:48)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53)
at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:77)
... 85 more
原因分析:dubbo 注册IP 为代理vpn产生虚拟IP;(我是本地调用远程dubbo服务)
解决方法:调整网卡优先级,优先本地IP,即可解决;
具体 参考 : https://www.sysgeek.cn/windows-10-change-priority-order-network-adapters/
调整顺序后:
本地网卡排在前面。
-------------------------------------- 2020-11-27 更新 --------------------------------------
好多朋友私信 更改网卡跃点的方法 太麻烦,另外 mac 本 修改网络顺序之后好像也不好使;
这里有个方便本地调试的方法,直接指定暴露服务的 host ,假如ip是10.0.88.88,直接在XX-dubbo.xml 文件下增加 host参数:
<dubbo:protocol name="dubbo" port="${dubbo.port}" host="10.0.88.88" />
最后,问题解决;