Mantis - Resin
Viewing Issue Advanced Details
4083 minor always 06-17-10 10:55 01-19-11 17:43
ferg  
ferg  
normal  
closed  
fixed  
none    
none 4.0.15  
0004083: CanDI serialization/deserialization
(rep by sweigersf)

I am trying to serialize and deserialize a CDI managed bean using Hessian:

Code:

@Inject MyBean sb;

...

ByteArrayOutputStream bos = new ByteArrayOutputStream();
Hessian2Output os = new Hessian2Output(bos);
os.writeObject(sb);

ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
Hessian2Input is = new Hessian2Input(bis);
MyBean ser = (MyBean) is.readObject(null);

Upon deserialization , I get the following error:

Code:

WARNING: Hessian/Burlap: 'wargames.WarGames__ResinWebBean' is an unknown class in EnvironmentClassLoader[resin-context]:
java.lang.ClassNotFoundException: wargames.WarGames__ResinWebBean in EnvironmentClassLoader[resin-context]

What seems to be happening is that Resin created a proxy for my injected bean (because I have a CDI interceptor registered on it). But the Hessian deserialization code does not seem to be aware of this proxy, throwing the ClassCastException. I get the same exception if I use normal Java Serialization.
Reply With Quote

Notes
(0004979)
ferg   
01-19-11 17:43   
ioc/0e40