You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ugur Dincer <ug...@hotmail.com> on 2006/02/17 16:18:10 UTC

ClassLoader problem during deserialization/restoring

Hi,

I've some ClassNotFoundException problem.

All the objects I want to serialize and deserialize implements 
Externazible/Serializable.

I'm running Tomcat 5 and JAVA5.

The .jar lib implementing serialization and deserialization of the 
application reside under server/lib (Catalina loader) and the 
application(SIP Servlets) are under webapps (WebappClassLoader).


1. I start my server and serialize the application and writes it to 
OutputStream in writeExternal(...)
2. I shutdown the server
3. I re-start the server and getting the stored serialized data. During 
deserialization I catch ClassNotFoundException since the object I'm trying 
to deserialize was known by WepappClassLoader during serialization. The 
Catalina loader hasn't any reference to the current class.

Is it possible to switch to (any WebappClassLoader) just before calling 
ObjectInput.readObject() and retrieve the right class using the correct 
classloader and thereafter go back to Catalina loader and continue with 
other operations.

How is this done in Tomcat Clusters and replication of Sessions? I found 
some info on the web and can't see any problem with my own implementation 
:-)

Regards
Ugur



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org