首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

项目中hessian的有关问题及解决,希望对大家有帮助

2012-11-07 
项目中hessian的问题及解决,希望对大家有帮助1,org.springframework.remoting.RemoteAccessException: Can

项目中hessian的问题及解决,希望对大家有帮助

1,org.springframework.remoting.RemoteAccessException: Cannot access Hessian service at [http://61.152.162.173/remote/remoteService];
出现这个异常一般是因为服务端操作出现异常引起的

2,com.caucho.hessian.io.HessianProtocolException: 501: java.io.IOException: Server returned HTTP response code: 501 for URL: http://61.152.162.173/remote/remoteService
出现这个原因,可能是因为代理问题(我的机器是通过squid代理上网的,并不是通过路由器),501服务器无法提供对请求中所要求功能的支持。如果服务器无法识别请求方法就会回应此状态代码,这意味着不能回应请求所要求的任何资源。

3,org.springframework.remoting.RemoteConnectFailureException: Cannot connect to Hessian service at http://127.0.0.1:8080/remote/remoteService]; nested exception is java.net.ConnectException: Connection refused: connect
连接不上hessian服务器.

4,客户端抛出的异常:
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 500 for URL: http://192.168.100.196/remote/FileServlet
?at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1174)
服务端抛出的异常如下:
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[FileServlet]] - Servlet.service() for servlet FileServlet threw exception
?com.caucho.hessian.io.HessianProtocolException: upload: expected end of call ('z') at '
解决:因为我的服务端要求上传的文件必须在userfiles目录下(代码:filePath.indexOf("userfiles");),判断我之前测试的文件没有放到该目录下,就出现了这种错误.

5,为什么客户端是对象,到了服务端就是map了呢?????
原因:我的list在上传前保存的是对象,经测试也不是map型,但到服务端从list获取的变成了map型,经分析是因为目录结构的原因,我的客户端po放到了domain目录下,服务端po放到domainobject下,我是用netCourseInfo组装信息的,客户端和服务端这两个文件不同(因为import的po的位置不一样),所以造成服务端反序列化时出现问题.

热点排行