日期:2014-05-20  浏览次数:20972 次

使用spring+hessian碰到如下的例外--expected string at 0x6d
我的spring版本是2.5.5,hessian是3.1.5

做了两个web应用,一个是client,一个是server,都放在resin的webapps下面,client使用http://127.0.0.1:8080/server/test.service访问

出现如下异常,搜了一下说是方法不能重载的问题。但是我的接口只暴露了一个方法:

[14:43:31.046] {http--8080-6} org.springframework.web.util.NestedServletException: Hessian skeleton invocation failed; nested exception is com.caucho.hessian.io.HessianProtocolException: expected string at 0x6d
[14:43:31.046] {http--8080-6} at org.springframework.remoting.caucho.HessianServiceExporter.handleRequest(HessianServiceExporter.java:73)
[14:43:31.046] {http--8080-6} at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
[14:43:31.046] {http--8080-6} at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
[14:43:31.046] {http--8080-6} at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
[14:43:31.046] {http--8080-6} at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
[14:43:31.046] {http--8080-6} at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
[14:43:31.046] {http--8080-6} at javax.servlet.http.HttpServlet.service(HttpServlet.java:153)
[14:43:31.046] {http--8080-6} at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
[14:43:31.046] {http--8080-6} at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
[14:43:31.046] {http--8080-6} at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:185)
[14:43:31.046] {http--8080-6} at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:264)
[14:43:31.046] {http--8080-6} at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:275)
[14:43:31.046] {http--8080-6} at com.caucho.server.port.TcpConnection.handleRequests(TcpConnection.java:644)
[14:43:31.046] {http--8080-6} at com.caucho.server.port.TcpConnection$AcceptTask.doAccept(TcpConnection.java:1311)
[14:43:31.046] {http--8080-6} at com.caucho.server.port.TcpConnection$AcceptTask.run(TcpConnection.java:1252)
[14:43:31.046] {http--8080-6} at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:866)
[14:43:31.046] {http--8080-6} at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:779)
[14:43:31.046] {http--8080-6} Caused by: com.caucho.hessian.io.HessianProtocolException: expected string at 0x6d
[14:43:31.046] {http--8080-6} at com.caucho.hessian.io.Hessian2Input.error(Hessian2Input.java:2737)
[14:43:31.046] {http--8080-6} at com.caucho.hessian.io.Hessian2Input.expect(Hessian2Input.java:2718)
[14:43:31.046] {http--8080-6} at com.caucho.hessian.io.Hessian2Input.readString(Hessian2Input.java:1333)
[14:43:31.046] {http--8080-6} at com.caucho.hessian.io.Hessian2Input.readMethod(Hessian2Input.java:277)
[14:43:31.046] {http--8080-6} at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:138)
[14:43:31.046] {http--8080-6} at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:110)
[14:43:31.046] {http--8080-6} at org.springframework.remoting.caucho.Hessian2SkeletonInvoker.invoke(Hessian2SkeletonInvoker.java:93)
[14:43:31.046] {http--8080-6} at org.springframework.remoting.caucho.HessianExporter.invoke(HessianExporter.java:142)
[14:43:31.046] {http--8080-6} at org.springframework.remoting.caucho.HessianServiceExporter.handleRequest(HessianServiceExporter.java:70)
[14:43:31.046] {http--8080-6} ... 16 more

------解决方案--------------------