---
title: "远程调用通过不了代理,求教"
author: "weishuwei"
date: "2007-05-12T10:40:16Z"
tags: []
categories: ["企业架构"]
slug: "untitled"
draft: false
lastmod: "2007-05-12T10:40:16Z"
id: 79061
url: "https://weishuwei.iteye.com/blog/79061"
---

我们采用hessian作远程处理,如果客户端直接采用路由器上网,则没什么影响,能连上服务端,但是如果通过代理,比如我们公司内部采用的是squid代理,则连不上服务端,不知道为什么  
以前是点击同步时出现如下错误(启动客户端时并不抛出):  
1,org.springframework.remoting.RemoteAccessException: Cannot access Hessian service at \[http://服务端ip/remote/remoteService]; nested exception is com.caucho.hessian.io.HessianProtocolException: 501: java.io.IOException: Server returned HTTP response code: 501 for URL: http://服务端ip/remote/remoteService

我们把hessian版本升级后,启动客户端就抛出如下错误  
严重: Servlet.service() for servlet remote threw exception  
com.caucho.hessian.io.HessianProtocolException: expected hessian call ('c') at code=-1 ch=?

请一下:

另外个人对hessian理解,请高人指正:  
hessian不能传递复杂对象,经本人测试,关系深度为2的是可以的,深度为3或以上是不行的,也就是说我们关系为一对一和一对多,可以采用hessian传输,如果是多对多则要把数据组装一下才能传输,这是个人理解,有不同见解的,请回复本人,在此表示感谢

本人msn为weishuwei@hotmail.com,可以联系本人