Failed to invoke the method subscribe in the service com.alibaba.dubbo.registry.RegistryService

本文主要是介绍Failed to invoke the method subscribe in the service com.alibaba.dubbo.registry.RegistryService,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1 异常信息

今天在写 dubbo 文章的时候遇到一个问题,倒是折腾了几分钟,百思不得其解,最后终于发现了。异常信息如下:

com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method subscribe in the service com.alibaba.dubbo.registry.RegistryService. Tried 3 times of the providers [localhost:2181, localhost:2182, localhost:2183] (3/3) from the registry localhost:2182 on the consumer 192.168.234.1 using the dubbo version 2.6.6. Last error is: Invoke remote method timeout. method: subscribe, provider: dubbo://localhost:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&backup=localhost:2183,localhost:2181&callbacks=10000&check=false&connect.timeout=10000&dubbo=2.0.2&interface=com.alibaba.dubbo.registry.RegistryService&lazy=true&methods=lookup,subscribe,unsubscribe,unregister,register&owner=sihai&pid=2872&qos.accept.foreign.ip=false&qos.enable=true&qos.port=55555&reconnect=false&remote.timestamp=1564280535444&sticky=true&subscribe.1.callback=true&timeout=10000&timestamp=1564280535444&unsubscribe.1.callback=false, cause: Waiting server-side response timeout by scan timer. start time: 2019-07-28 10:22:38.380, end time: 2019-07-28 10:22:48.401, client elapsed: 9 ms, server elapsed: 10011 ms, timeout: 10000 ms, request: Request [id=2, version=2.0.2, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=subscribe, parameterTypes=[class com.alibaba.dubbo.common.URL, interface com.alibaba.dubbo.registry.NotifyListener], arguments=[consumer://192.168.234.1/com.alibaba.dubbo.registry.RegistryService?application=provider&backup=localhost:2183,localhost:2181&callbacks=10000&connect.timeout=10000&dubbo=2.0.2&interface=com.alibaba.dubbo.registry.RegistryService&lazy=true&methods=lookup,subscribe,unsubscribe,unregister,register&owner=sihai&pid=2872&qos.accept.foreign.ip=false&qos.enable=true&qos.port=55555&reconnect=false&sticky=true&subscribe.1.callback=true&timeout=10000&timestamp=1564280535444&unsubscribe.1.callback=false, com.alibaba.dubbo.registry.integration.RegistryDirectory@353352b6], attachments={path=com.alibaba.dubbo.registry.RegistryService, sys_callback_arg-1=892555958, interface=com.alibaba.dubbo.registry.RegistryService, version=0.0.0, timeout=10000}]], channel: 192.168.234.1:0 -> localhost/127.0.0.1:2181at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:102)at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:244)at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75)at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)at com.alibaba.dubbo.common.bytecode.proxy0.subscribe(proxy0.java)at com.alibaba.dubbo.registry.dubbo.DubboRegistry.doSubscribe(DubboRegistry.java:151)at com.alibaba.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:196)

其中,可以发现最重要异常信息就是:

com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method subscribe in the service com.alibaba.dubbo.registry.RegistryService

如果你了解 dubbo 的架构的话,其实你很快就能发现,这就是注册中心的问题。后来排查发现,确实是注册中心出了问题。

2 解决问题

知道是注册中心出现了问题,刚刚开始以为是我设置了只订阅的模式,但是,检查配置发现,并不是这种模式出现了问题。

后来,再仔细看了一下之前的配置发现,是我没有指明注册中心是哪个?(以前用的是zookeeper)。

所以,到这里就很简单了,在下面的代码中指明注册中心即可。

<dubbo:registry timeout="10000" address="localhost:2182,localhost:2183,localhost:2181"></dubbo:registry>

改为

<dubbo:registry protocol="zookeeper" timeout="10000" address="localhost:2182,localhost:2183,localhost:2181"></dubbo:registry>

这样问题就解决了。

这篇关于Failed to invoke the method subscribe in the service com.alibaba.dubbo.registry.RegistryService的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/495762

相关文章

Android里面的Service种类以及启动方式

《Android里面的Service种类以及启动方式》Android中的Service分为前台服务和后台服务,前台服务需要亮身份牌并显示通知,后台服务则有启动方式选择,包括startService和b... 目录一句话总结:一、Service 的两种类型:1. 前台服务(必须亮身份牌)2. 后台服务(偷偷干

Spring AI Alibaba接入大模型时的依赖问题小结

《SpringAIAlibaba接入大模型时的依赖问题小结》文章介绍了如何在pom.xml文件中配置SpringAIAlibaba依赖,并提供了一个示例pom.xml文件,同时,建议将Maven仓... 目录(一)pom.XML文件:(二)application.yml配置文件(一)pom.xml文件:首

使用TomCat,service输出台出现乱码的解决

《使用TomCat,service输出台出现乱码的解决》本文介绍了解决Tomcat服务输出台中文乱码问题的两种方法,第一种方法是修改`logging.properties`文件中的`prefix`和`... 目录使用TomCat,service输出台出现乱码问题1解决方案问题2解决方案总结使用TomCat,

解决systemctl reload nginx重启Nginx服务报错:Job for nginx.service invalid问题

《解决systemctlreloadnginx重启Nginx服务报错:Jobfornginx.serviceinvalid问题》文章描述了通过`systemctlstatusnginx.se... 目录systemctl reload nginx重启Nginx服务报错:Job for nginx.javas

Python Invoke自动化任务库的使用

《PythonInvoke自动化任务库的使用》Invoke是一个强大的Python库,用于编写自动化脚本,本文就来介绍一下PythonInvoke自动化任务库的使用,具有一定的参考价值,感兴趣的可以... 目录什么是 Invoke?如何安装 Invoke?Invoke 基础1. 运行测试2. 构建文档3.

模版方法模式template method

学习笔记,原文链接 https://refactoringguru.cn/design-patterns/template-method 超类中定义了一个算法的框架, 允许子类在不修改结构的情况下重写算法的特定步骤。 上层接口有默认实现的方法和子类需要自己实现的方法

消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法

消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法   消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法 [转载]原地址:http://blog.csdn.net/x605940745/article/details/17911115 消除SDK更新时的“

SOMEIP_ETS_095: SD_Check_subscribe_eventgroup_ttl_expired

测试目的: 验证DUT(Device Under Test)能够检测到测试器(Tester)的订阅已过期(ttl = 3秒),并且在TTL过期后不响应测试器触发的事件。 描述 本测试用例旨在确保DUT能够识别测试器的订阅已过期,并在订阅过期后不响应测试器通过TriggerEventUint8方法触发的事件。 测试拓扑: 具体步骤: TESTER:发送订阅事件组消息,用于事件组0x0

android java.io.IOException: open failed: ENOENT (No such file or directory)-api23+权限受权

问题描述 在安卓上,清单明明已经受权了读写文件权限,但偏偏就是创建不了目录和文件 调用mkdirs()总是返回false. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.READ_E

UserWarning: mkl-service package failed to import

安装完成anaconda,并设置了两个环境变量  之后再控制台运行python环境,输入import numpy as np,提示错误 D:\InstallFolder\Anaconda3\lib\site-packages\numpy\__init__.py:143: UserWarning: mkl-service package failed to import, therefore