You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2001/09/20 07:49:03 UTC

DO NOT REPLY [Bug 3733] - session serialization problem

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3733>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3733

session serialization problem





------- Additional Comments From jon@latchkey.com  2001-09-19 22:49 -------
The Turbine process is this:

#1. Turbine.init() (this is the servlet), initializes Torque.java with the right 
ExtendedProperties and also calls Torque's init() method. The EP is 
stored within Torque as a static variable and the Torque init() method 
internally initializes a couple static HashMaps and other stuff. The key 
here is that Torque relies on static information within itself.

#2. An object that depends on Torque is created and placed into the 
Servlet Session. When this object is serialized, all of its static members 
are lost. One of those static members looks like this:

    /** the mapbuilder for this class */
    protected static final ActivityMapBuilder mapBuilder = 
        (ActivityMapBuilder)getMapBuilder(ActivityMapBuilder.CLASS_NAME);

The super.getMapBuilder(ActivityMapBuilder.CLASS_NAME) then makes a 
call to Torque.getMapBuilder(String) which then depends on the static 
internal HashMaps to have already been populated with data as a result 
of Torque.init() being called in the servlet.init()

#3. When the classloader dumps and reloads, Catalina seems to first 
de-serialize the objects in the session. The reason I know this is that 
when the Torque.getMapBuilder() is called in order to re-populate the 
above static final variable, it gets NPE's on the internal HashMaps.

It appears that the solution to this problem would be to call the servlet's 
init() method first and then try to de-serialize the sessions. Hopefully this 
description will also provide information on creating a test case for this.

comments?