文档章节

dubbo异常: Failed to invoke the method getFormulaZtree in the service 异常解决方案

老吴头
 老吴头
发布于 2017/04/05 18:13
字数 854
阅读 198
收藏 0

当调用dubbo远程服务方法时报错:

2017-04-05 18:07:41 [http-apr-8080-exec-4] [ERROR] com.ipharmacare.yb.formula.controller.FormulaController61 -获取计算公式信息目录树出错!
com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method getFormulaZtree in the service com.ipharmacare.yb.services.formula.IFormulaApi. Tried 3 times of the providers [10.1.2.37:20885] (1/1) from the registry 10.1.2.37:2181 on the consumer 172.31.187.8 using the dubbo version 2.8.4.1. Last error is: Failed to invoke remote method: getFormulaZtree, provider: dubbo://10.1.2.37:20885/com.ipharmacare.yb.services.formula.IFormulaApi?anyhost=true&application=yb-web&check=false&default=true&default.check=false&default.payload=83886080&default.timeout=300000&dubbo=2.8.4.1&generic=false&interface=com.ipharmacare.yb.services.formula.IFormulaApi&logger=slf4j&methods=updateFormula,getFormulaZtree,getFormulaById&payload=83886080&pid=9412&side=consumer&timestamp=1491386763876, cause: Fail to decode request due to: RpcInvocation [methodName=getFormulaZtree, parameterTypes=null, arguments=null, attachments={dubbo=2.8.4.1, input=437, path=com.ipharmacare.yb.services.formula.IFormulaApi, version=0.0.0}]
	at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:101) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:227) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:72) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.common.bytecode.proxy5.getFormulaZtree(proxy5.java) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.ipharmacare.yb.formula.service.FormulaService.getFormulaZtree(FormulaService.java:46) ~[classes/:na]
	at com.ipharmacare.yb.formula.controller.FormulaController.getFormulaZtree(FormulaController.java:51) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
	at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) [spring-web-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) [spring-web-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) [spring-webmvc-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) [spring-webmvc-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:685) [spring-webmvc-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) [spring-webmvc-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919) [spring-webmvc-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851) [spring-webmvc-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953) [spring-webmvc-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844) [spring-webmvc-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:624) [servlet-api.jar:na]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829) [spring-webmvc-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) [servlet-api.jar:na]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [catalina.jar:7.0.72]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.72]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat7-websocket.jar:7.0.72]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.72]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.72]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring-web-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106) [spring-web-3.2.9.RELEASE.jar:3.2.9.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.72]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.72]
	at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) [urlrewritefilter-4.0.3.jar:4.0.3]
	at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) [urlrewritefilter-4.0.3.jar:4.0.3]
	at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) [urlrewritefilter-4.0.3.jar:4.0.3]
	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394) [urlrewritefilter-4.0.3.jar:4.0.3]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.72]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.72]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) [catalina.jar:7.0.72]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [catalina.jar:7.0.72]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) [catalina.jar:7.0.72]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) [catalina.jar:7.0.72]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:7.0.72]
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) [catalina.jar:7.0.72]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [catalina.jar:7.0.72]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442) [catalina.jar:7.0.72]
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1083) [tomcat-coyote.jar:7.0.72]
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640) [tomcat-coyote.jar:7.0.72]
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517) [tomcat-coyote.jar:7.0.72]
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506) [tomcat-coyote.jar:7.0.72]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_112]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_112]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.72]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]
Caused by: com.alibaba.dubbo.remoting.RemotingException: Fail to decode request due to: RpcInvocation [methodName=getFormulaZtree, parameterTypes=null, arguments=null, attachments={dubbo=2.8.4.1, input=437, path=com.ipharmacare.yb.services.formula.IFormulaApi, version=0.0.0}]
	at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.returnFromResponse(DefaultFuture.java:190) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.get(DefaultFuture.java:110) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.get(DefaultFuture.java:84) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker.doInvoke(DubboInvoker.java:96) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:148) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:53) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:48) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:74) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:77) ~[dubbo-2.8.4.1.jar:2.8.4.1]
	... 54 common frames omitted

在dubbo配置文件中

dubbo.container=log4j,spring
dubbo.application.name=web
dubbo.application.owner=ipharmacare
#dubbo.registry.address=multicast://224.5.6.7:1234
dubbo.registry.address=zookeeper\://10.1.2.37\:2181  // 由于修改了代码  并没有提交上去,所以该地址指向的是主机,而不是本地.当web调用我在注册中心写的方法时,肯定出错.
dubbo.protocol.name=dubbo
dubbo.protocol.port=38889
dubbo.consumer.timeout=300000
#dubbo.registry.address=redis://127.0.0.1:6379
#dubbo.registry.address=dubbo://127.0.0.1:9090
#dubbo.consumer.timeout=2
dubbo.log4j.file=logs/yb-web.log
dubbo.log4j.level=WARN
noPermUrl=

解决方案: 将

dubbo.registry.address=zookeeper\://10.1.2.37\:2181

改为

dubbo.registry.address=zookeeper\://127.0.0.1\:2181

遇到该异常可能还有其他情况: 实体类没有实现java.io.Serializable,因为是远程服务,所有必须实现序列化接口

暂时就是这么些,欢迎大家补充!

© 著作权归作者所有

共有 人打赏支持
老吴头
粉丝 0
博文 9
码字总数 9040
作品 0
杭州
后端工程师
dubbo+springboot整合异常

在整合dubbo+springboot的项目,项目采用分布式开发。分别为springboot-server,springboot-client两个工程。使用main函数启动springboot-server,发现正常。打开dubbo-admin查看,发现服务也...

美丽不打折
2017/10/19
0
2
FAQ invalid constant type: 15

java.lang.IllegalStateException: Failed to transform class with name com.chanjet.csp.boss.cia.api.SubscribeApiTest. Reason: java.io.IOException: invalid constant type: 15 at org......

yangming0322
2016/10/11
107
0
配置dubbo-monitor无charts下相关服务统计图

说明:最近搭建dubbo rest技术整合,选用版本zookeeper3.4.6; dubbox-2.8.4a.jar ; dubbo-admin-2.8.4; dubbo-monitor-2.8.4; 环境介绍完毕。 前期zookeeper集群,dubbo-admin控制台,以及d...

htnn
2016/10/28
1K
3
dubbo超时,这种情况是因为什么导致

com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method getCollectReqInfo in the service com.tairan.cloud.credit.service.CreditService. Tried 1 times of the providers [1......

诠释这低调
2017/03/03
670
1
dubbo服务spring jar方式启动报错

2018-01-03 20:40:58,108 [main] ERROR [com.alibaba.dubbo.container.Main] - [DUBBO] Error creating bean with name 'columnService': Unsatisfied dependency expressed through field '......

xunzhong
01/03
9
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

RabbitMQ在CentOS环境安装

1.废话不多说准备一台虚拟机,系统为centos,我这里使用的系统版本如下图所示:

凌晨一点
43分钟前
0
0
线程池相关

在java.util.concurrent包下,提供了一系列与线程池相关的类。 使用线程池的好处 降低资源消耗。通过重复利用已创建的线程降低线程创建和销毁造成的消耗; 提高响应速度。当任务到达时,任务...

edwardGe
45分钟前
0
0
学习大数据这三个关键技术是一定要掌握!

大数据时代全面来临,大数据、人工智能等技术引领科技创新潮流,获得国家政策大力支持,前景广阔。学习大数据技术的人自然是络绎不绝, 学习大数据虽然是一个趋势,但也要注意大数据培训课程...

董黎明
今天
0
0
jetbrains 上传代码到github

设置中找github 获取token 验证是否成功 测试git 生成key,一路回车即可 ssh-keygen -t rsa -C “youremail@example.com” 打开pub复制key,需要再次输入一次密码 验证是否成功,输入yes即可...

阿豪boy
今天
0
0
分布式服务框架(拾遗)

前言 现在的大部分工程都已经是基于分布式架构来处理。所以这里对分布式框架做一个简单的总结 常用的RPC框架 RPC框架原理 RPC(Remote Procedure Call,远程过程调用)一般用来实现部署在不同...

kukudeku
今天
3
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部