[TODO]com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method
异常信息如下:
2018-10-30 20:00:50.230 ERROR
java.util.concurrent.ExecutionException: com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method query in the service cn.fraudmetrix.skuld.api.client.intf.IListValueService. Tried 1 times of the providers [192.168.72.95:20880] (1/10) from the registry 192.168.47.83:2181 on the consumer 192.168.127.80 using the dubbo version 2.5.3. Last error is: null
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_60]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_60]
at cn.fraudmetrix.alliance.service.MobilPhoneRuleService.getMobilPhoneRuleObj(MobilPhoneRuleService.java:73) ~[alliance-biz-service-1.0.0.jar:na]
at cn.fraudmetrix.alliance.service.impl.MobilPhoneInfoServiceImpl.lambda$getMobilPhoneRule$1(MobilPhoneInfoServiceImpl.java:143) [alliance-biz-service-1.0.0.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_60]
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_60]
Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method query in the service cn.fraudmetrix.skuld.api.client.intf.IListValueService. Tried 1 times of the providers [192.168.72.95:20880] (1/10) from the registry 192.168.47.83:2181 on the consumer 192.168.127.80 using the dubbo version 2.5.3. Last error is: null
at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:101) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:227) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:72) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.common.bytecode.proxy1.query(proxy1.java) ~[na:2.5.3]
at cn.fraudmetrix.alliance.service.processor.BadAttributeProcessor.execute(BadAttributeProcessor.java:55) ~[alliance-biz-service-1.0.0.jar:na]
at cn.fraudmetrix.alliance.service.processor.BadAttributeProcessor.execute(BadAttributeProcessor.java:22) ~[alliance-biz-service-1.0.0.jar:na]
at cn.fraudmetrix.alliance.service.processor.AbstractProcessor.process(AbstractProcessor.java:17) ~[alliance-biz-service-1.0.0.jar:na]
at cn.fraudmetrix.alliance.service.processor.AbstractProcessor$$FastClassBySpringCGLIB$$a202aaec.invoke(<generated>) ~[alliance-biz-service-1.0.0.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) ~[spring-aop-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) ~[spring-aop-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at cn.fraudmetrix.alliance.service.aop.MetricsAop.execute(MetricsAop.java:27) ~[alliance-biz-service-1.0.0.jar:na]
at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629) ~[spring-aop-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) ~[spring-aop-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) ~[spring-aop-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) ~[spring-aop-4.3.0.RELEASE.jar:4.3.0.RELEASE]
at cn.fraudmetrix.alliance.service.processor.BadAttributeProcessor$$EnhancerBySpringCGLIB$$2f8bd77e.process(<generated>) ~[alliance-biz-service-1.0.0.jar:na]
at cn.fraudmetrix.alliance.service.MobilPhoneRuleService.lambda$getMobilPhoneRuleObj$5(MobilPhoneRuleService.java:54) ~[alliance-biz-service-1.0.0.jar:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_60]
... 3 common frames omitted
java.lang.NullPointerException: null
注意以上类,翻开源码:
- package com.alibaba.dubbo.rpc.cluster.support;
- /**
- * 失败转移,当出现失败,重试其它服务器,通常用于读操作,但重试会带来更长延迟。
- *
- * <a href="http://en.wikipedia.org/wiki/Failover">Failover</a>
- *
- * @author william.liangf
- * @author chao.liuc
- */
- public class FailoverClusterInvoker<T> extends AbstractClusterInvoker<T> {
- private static final Logger logger = LoggerFactory.getLogger(FailoverClusterInvoker.class);
- public FailoverClusterInvoker(Directory<T> directory) {
- super(directory);
- }
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public Result doInvoke(Invocation invocation, final List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
- List<Invoker<T>> copyinvokers = invokers;
- checkInvokers(copyinvokers, invocation);
- int len = getUrl().getMethodParameter(invocation.getMethodName(), Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
- if (len <= 0) {
- len = 1;
- }
- // retry loop.
- RpcException le = null; // last exception.
- List<Invoker<T>> invoked = new ArrayList<Invoker<T>>(copyinvokers.size()); // invoked invokers.
- Set<String> providers = new HashSet<String>(len);
- for (int i = 0; i < len; i++) {
- //重试时,进行重新选择,避免重试时invoker列表已发生变化.
- //注意:如果列表发生了变化,那么invoked判断会失效,因为invoker示例已经改变
- if (i > 0) {
- checkWheatherDestoried();
- copyinvokers = list(invocation);
- //重新检查一下
- checkInvokers(copyinvokers, invocation);
- }
- Invoker<T> invoker = select(loadbalance, invocation, copyinvokers, invoked);
- invoked.add(invoker);
- RpcContext.getContext().setInvokers((List)invoked);
- try {
- Result result = invoker.invoke(invocation);
- if (le != null && logger.isWarnEnabled()) {
- logger.warn("Although retry the method " + invocation.getMethodName()
- + " in the service " + getInterface().getName()
- + " was successful by the provider " + invoker.getUrl().getAddress()
- + ", but there have been failed providers " + providers
- + " (" + providers.size() + "/" + copyinvokers.size()
- + ") from the registry " + directory.getUrl().getAddress()
- + " on the consumer " + NetUtils.getLocalHost()
- + " using the dubbo version " + Version.getVersion() + ". Last error is: "
- + le.getMessage(), le);
- }
- return result;
- } catch (RpcException e) {
- if (e.isBiz()) { // biz exception.
- throw e;
- }
- le = e;
- } catch (Throwable e) {
- le = new RpcException(e.getMessage(), e);
- } finally {
- providers.add(invoker.getUrl().getAddress());
- }
- }
- throw new RpcException(le != null ? le.getCode() : 0, "Failed to invoke the method "
- + invocation.getMethodName() + " in the service " + getInterface().getName()
- + ". Tried " + len + " times of the providers " + providers
- + " (" + providers.size() + "/" + copyinvokers.size()
- + ") from the registry " + directory.getUrl().getAddress()
- + " on the consumer " + NetUtils.getLocalHost() + " using the dubbo version "
- + Version.getVersion() + ". Last error is: "
- + (le != null ? le.getMessage() : ""), le != null && le.getCause() != null ? le.getCause() : le);
- }
- }
跟踪异常栈,可以抛出异常在以下地方:
关注初始报错信息:
- java.util.concurrent.ExecutionException: com.alibaba.dubbo.rpc.RpcException:
Failed to invoke the method query in the service cn.fraudmetrix.skuld.api.client.intf.IListValueService.
Tried 1 times of the providers [192.168.121.230:20880] (1/10) from the registry 192.168.47.83:2181 on the consumer 192.168.55.67
using the dubbo version 2.5.3. Last error is: null
注意以上是null, 问题就在这里,网上找了一些资料,也没发现相关的原因,只能本地翻看源码论证可能性:
可能性1: 请求超时:
异常信息:
- Failed to invoke the method query in the service cn.fraudmetrix.skuld.api.client.intf.IListValueService.
Tried 3 times of the providers [10.57.240.10:20880] (1/1) from the registry 192.168.6.55:2181 on the consumer 10.57.240.10
using the dubbo version 2.5.3. Last error is:
Invoke remote method timeout. method: query, provider: dubbo://10.57.240.10:20880/....
后面有具体的原因,timeout,一目了然。
可能性2:服务提供者未启动:
异常信息:
- om.alibaba.dubbo.rpc.RpcException: Forbid consumer 10.57.240.10 access service cn.fraudmetrix.skuld.api.client.intf.IListValueService from registry 192.168.6.55:2181 use dubbo version 2.5.3, Please check registry access list (whitelist/blacklist).
- at com.alibaba.dubbo.registry.integration.RegistryDirectory.doList(RegistryDirectory.java:579)
- at com.alibaba.dubbo.rpc.cluster.directory.AbstractDirectory.list(AbstractDirectory.java:73)
- at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.list(AbstractClusterInvoker.java:260)
- at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:219)
- at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:72)
- at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)
- at com.alibaba.dubbo.common.bytecode.proxy0.query(proxy0.java)
- at cn.fraudmetrix.skuld.dubbotest.ValueQueryTest.runTest(ValueQueryTest.java:70)
- at cn.fraudmetrix.skuld.dubbotest.App.main(App.java:15)
在AbstractClusterInvoker中有以下代码:
- List<Invoker<T>> invokers = doList(invocation);
直接异常了。
可能性3:服务提供者启动,跳过验证后宕机:
异常信息:
- Failed to invoke the method query in the service cn.fraudmetrix.skuld.api.client.intf.IListValueService.
Tried 3 times of the providers [10.57.240.10:20880] (1/1) from the registry 192.168.6.55:2181 on the consumer 10.57.240.10
using the dubbo version 2.5.3. Last error is:
Failed to invoke remote method: query, provider: dubbo://10.57.240.10:20880/.....
后面也有相关的原因。
现在报个null还不好找原因啊。
[TODO]com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method的更多相关文章
- com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method findUserByUserNo in the service wusc.edu.facade.user.service.PmsUserFacade.
017-04-25 10:55:30,505 INFO [AbstractRegistry.java:302] : [DUBBO] Register: consumer://192.168.1.101 ...
- dubbo+zookeeper报错:com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method
com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method可能的错误原因有三个前两个是从网上摘得, 第三个是自己解决的 1.需要进行 ...
- com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method
查看了网友们的错误原因, 需要进行实例化的类没有进行实例化,具体没有实例化的类会在错误信息中显示,在错误信息中搜索“Serializable”即可找到将其实现序列化可消除错误. 是在使用Dubbo提供 ...
- com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote method解决方法
报错日记: Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote method: getUserAuthLeve ...
- 关于dubbo调度时出现Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method insertTestTb in the service cn.cuibusi.core.service.TestTbService.的解决办法
在用dubbo跨项目调度service时出现如下错误: 错误原因:pojo没有实现序列化 解决方法:在pojo实现序列化接口即可
- 问题:com.alibaba.dubbo.rpc.RpcException: Failed to invoke ......
个人解决流程: 一看到这个问题,下意识想到了是dubbo远程连接的问题,可能是dubbo本身的问题,于是在虚拟机上另外一台dubbo能正常脸上的服务器上重新尝试,还是报相同的错误,并且在dubbo-a ...
- 报错 500 - Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException的解决放案
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/loveliness_peri/artic ...
- com.alibaba.dubbo.rpc.RpcException: Fail to start server(url: dubbo://192.16。。
开启了linux的zookeeper服务,启动e3-manager时发现出现com.alibaba.dubbo.rpc.RpcException: Fail to start server(url: ...
- 使用dubbo引用和发布服务时出现的异常:HTTP状态500 - 请求处理失败; 嵌套异常是com.alibaba.dubbo.rpc.RpcException:无法在服务cn.e3mall.service.ItemService中调用方法getTbItemById。使用dubbo版本2.5.3在消费者...
异常情况如下: 从异常看,主要是因为TbItem没有序列化: 分析问题: 表现层调用服务端时返回了一个TbItem对象即Java对象,此时这个对象远程调用拿过来必须进行序列化,要进行网络传输必须先要把 ...
随机推荐
- Android实现两次按下返回键退出
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BAC ...
- 每天进步一点点——论fork()函数与Linux中的多线程编程
转载请说明出处:http://blog.csdn.net/cywosp/article/details/27316803 一.fork()函数 在操作系统的基本概念中进程是程序的一次运行,且是 ...
- 分享JavaScript获取网页关闭与取消关闭的事件
在做Web开发时,我们经常用到页面关闭事件onbeforeunload,可以给用户一个选择放弃关闭的机会,就比如这个博客编辑器.如果用户选择了离开,那么onunload事件自然会触发:但若用户选择了取 ...
- Struts2 校验框架学习笔记
Struts2 校验框架 Struts2 和Struts1同样也提供了校验框架,但在Struts2 已经不再把校验框架做为一个插件,而是已经内置到了Struts2中,而且配置起来更为简单方便,功能也更 ...
- 跟我学Spring3(9.1):Spring的事务之数据库事务概述
原文出处: 张开涛 9.1 数据库事务概述 事务首先是一系列操作组成的工作单元,该工作单元内的操作是不可分割的,即要么所有操作都做,要么所有操作都不做,这就是事务. 事务必需满足ACID(原子性.一致 ...
- bashrc和profile的用途和区别
使用终端登录Linux操作系统的控制台后,会出现一个提示符号(例如:#或~),在这个提示符号之后可以输入命令,Linux根据输入的命令会做回应,这一连串的动作是由一个所谓的Shell来做处理. She ...
- Configuring HDFS High Availability
Configuring HDFS High Availability 原文请訪问 http://blog.csdn.net/ashic/article/details/47024617,突袭新闻小灵儿 ...
- scala的一些特殊用法
1.创建多行字符串,只要把多行字符串放在3个双引号间("""...""")即可.这是Scala对于here document,或者叫here ...
- 游戏:贪吃虫(GreedyMaggot)
该游戏类似于贪吃蛇,但可以在二维平面上以任意方向前进.当吃到食物手,食物会从虫头向虫尾移动,移到虫尾后,贪吃虫长度会增加.本来给它取名为贪吃蛆的,并且工程的英文名Maggot就是蛆的意思,后来想想有点 ...
- 第十六章 springboot + OKhttp + String.format
模拟浏览器向服务器发送请求四种方式: jdk原生的Http包下的一些类 httpclient(比较原始,不怎么用了):第一章 HttpClient的使用 Okhttp(好用,推荐) retrofit( ...