PDA

View Full Version : Deserialization from byte array


St.
03-27-2012, 06:53 PM
Hi!

I have simple example: HessianClient, HessianService and MyHessianProxy.
MyHessianProxy gets request from HessianClient then redirects it to HessianService, gets response and redirects it to HessianClient. That's all over HTTP.
But in MyHessianProxy I need to get copy of HessianService's response object.
I try to get it via RemoteDeserializer but have exceptions.

Is there any way to resolve my problem?

Part of my code

...
//responseBytes - HessianService's response
ByteArrayInputStream bin = new ByteArrayInputStream(responseBytes);
Hessian2Input input = new Hessian2Input(bin);
RemoteDeserializer deserializer = new RemoteDeserializer();
//in log it's true
deserializer.isReadResolve();
Object obj = deserializer.readObject(input);
..


Exception
...
com.caucho.hessian.io.HessianProtocolException: unexpected end of file
...