文档章节

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

老吴头
 老吴头
发布于 2017/04/05 18:13
字数 854
阅读 289
收藏 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
基于动态代理 Mock dubbo 服务的实现方案

序言 背景概述 公司目前 Java 项目提供服务都是基于 Dubbo 框架的,而且 Dubbo 框架已经成为大部分国内互联网公司选择的一个基础组件。 在日常项目协作过程中,其实会碰到服务不稳定、不满足...

有赞技术
06/04
0
0
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

没有更多内容

加载失败,请刷新页面

加载更多

一切都靠大数据:滴滴已封禁4.3万人员、车辆

这段时间以来,滴滴出行相继出炉了各种整改措施,包括自身安全建设和外部社会共建,昨日就刚刚宣布正在筹备建立安全监督顾问委员会。 据媒体最新报道,9月30日,上海市交通委员会执法总队、上...

linuxCool
45分钟前
4
0
awk命令用法介绍

10月18日任务 9.6/9.7 awk 1.awk(上)(下) 1.awk 分段操作功能 指定分隔符,并把第一段打印出来,不会改动文件内容 将所有内容打印出来 awk 没有指定分隔符号,则会默认用空格或者空白字符...

hhpuppy
今天
4
0
Spring Cloud Eureka Server高可用之:在线扩容

本文共 1591字,阅读大约需要 6分钟 ! 概述 业务微服务化以后,我们要求服务高可用,于是我们可以部署多个相同的服务实例,并引入负载均衡机制。而微服务注册中心作为微服务化系统的重要单元...

CodeSheep
今天
3
0
内网esxi主机上安装CoreOS虚拟机

CoreOS是一个为专门运行容器而设计的轻量级linux发行版,旨在通过轻量的系统架构和灵活的应用程序部署能力简化数据中心的维护成本和复杂度。它没有包管理工具,运行容器化应用以提供服务;默...

hiwill
今天
2
0
20181018 上课截图

![](https://oscimg.oschina.net/oscnet/49f66c08ab8c59a21a3b98889d961672f30.jpg) ![](https://oscimg.oschina.net/oscnet/a61bc2d618b403650dbd4bf68a671fabecb.jpg)......

小丑鱼00
今天
3
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部