今天在使用hessian时碰到了如下的问题:
org.springframework.remoting.RemoteAccessException: Cannot access Hessian remote service at [
http://localhost:8080/logcenter/remoting/hessianQueryLog
]; nested exception is com.caucho.hessian.io.HessianProtocolException: expected hessian reply at end of file
?
at org.springframework.remoting.caucho.HessianClientInterceptor.convertHessianAccessException(HessianClientInterceptor.java:254)
at org.springframework.remoting.caucho.HessianClientInterceptor.invoke(HessianClientInterceptor.java:225)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy1.queryLogItemByIdForHessian(Unknown Source)
at com.xiu.log.qatest.LogHessianTest.main(LogHessianTest.java:55)
Caused by: com.caucho.hessian.io.HessianProtocolException: expected hessian reply at end of file
?
at com.caucho.hessian.io.Hessian2Input.error(Hessian2Input.java:2701)
at com.caucho.hessian.io.Hessian2Input.startReply(Hessian2Input.java:405)
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:218)
at $Proxy0.queryLogItemByIdForHessian(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.remoting.caucho.HessianClientInterceptor.invoke(HessianClientInterceptor.java:219)
... 4 more
这是因为接口中出现方法重载,在调用时,服务器端会跑出异常。
在整合spring中,在客户端的配置里面加上如下代码可以解决:
<property name="overloadEnabled" value="true"></property>
spring2.5.6 + hessian 4.0.1,采用remoting-servlet.xml的方式进行配置,客户端调用时出现如下错误,换成hessian 3.1.5就正常了。
Exception in thread "main" com.caucho.hessian.client.HessianRuntimeException: com.caucho.hessian.io.HessianProtocolException: '?' is an unknown code
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:268)
at $Proxy0.queryBusicardsTest(Unknown Source)
at client.UserSimpleTest.main(UserSimpleTest.java:21)
Caused by: com.caucho.hessian.io.HessianProtocolException: '?' is an unknown code
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:266)
... 2 more
spring2.5.6不支持hessian过高版本,最后只好换成在web.xml中配置hessian的访问地址
分享到:
相关推荐
hessian关于java使用的一个小例子
hessian 使用实例,更简单的service
Hessian 是一种轻量级的二进制RPC通讯框架,基于HTTP使用servlet 暴漏web service. 本文描述了单独使用和及spring集成使用,并介绍了证书加密,签名及非证书类如DES加密方式. 文尾附官方实例链接.
Hessian(C#)介绍及使用说明Hessian(C#)介绍及使用说明
远程方法调用的比较,Hessian方法的介绍和相关配置.Hessian是一个轻量级的remoting on http工具,...只是它不使用SOAP协议,但相比webservice而言更简单、快捷。这个文件可以是hessian在spring项目和web项目的简单配置
一个简单的Hessian,简单介绍了Hessian的使用方式,介绍了Hessian和Spring集成的使用方式,以及单独使用Hessian的方式。
此例子有两个工程,hessianServer(服务端工程),hessianClient(客户端工程),把 hessianServer工程 启动之后就可以通过 hessianClient 访问 服务端的服务了。
android端使用hessian跟web服务器通讯,导入即可运行,有问题请在博客留言。http://blog.csdn.net/tan313/article/details/49536891
Hessian多个版本下载,包括Hessian3.1.6,Hessian3.2.1,Hessian4.0.7
该案例有hessian java python,该案例有hessian java python,该案例有hessian java python
hessian学习实例,hessian框架例子,与Spring集成。包括了server端和client端
基于matlab使用 hessian 特征值增强 2D3D 图像中的血管脊状结构
此代码展示了如何使用 springMVC 搭建 hessian 服务和 Controller 服务,里面还有如何使用的 readme 文件,告诉你如何使用它们。
提供hessian-4.0.37.jar下载,及服务器端与客户端通信的实例
hessian源码
1、开发环境:eclipse3.1 + jdk1.5; 2、样例说明: 1)spring + hessian; 2)hessian。 3、样例内容: 1)HashMap传递; 2)简单对象传递; 3)异常处理
hessian资料3hessian资料3hessian资料3hessian资料3hessian资料3
hessian客户端的vc使用
Hessian服务端 入门程序
在开发过程中,有时需公用某个工程的接口,需要用到hessian实现远程调用