hessian 使用过程碰到的异常

今天在使用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的访问地址
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值