markt 2004/05/22 16:21:10
Modified: catalina/src/share/org/apache/catalina/session
StoreBase.java
Log:
Fix bug 19034. After a change to a class, sessions in the store may throw
exceptions as the serialised class is not longer compatible with the new
class. The bug describes an issue when InvalidClassException was
thrown. An apparently related bug (22716) referred to a
NotSerializableException so to be on the safe side I implemented a
solution that catches all exceptions.
The patch is based on a solution suggested by Ronald Klop.
This patch is untested as I was unable to reproduce the exception
described on my development machine.
Revision Changes Path
1.9 +13 -11
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StoreBase.java
Index: StoreBase.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StoreBase.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- StoreBase.java 30 Apr 2004 19:15:26 -0000 1.8
+++ StoreBase.java 22 May 2004 23:21:10 -0000 1.9
@@ -67,9 +67,9 @@
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.IOException;
+
import org.apache.catalina.Container;
import org.apache.catalina.Lifecycle;
-import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.Logger;
@@ -328,12 +328,14 @@
}
remove(session.getId());
}
- } catch (IOException e) {
- log (e.toString());
- e.printStackTrace();
- } catch (ClassNotFoundException e) {
- log (e.toString());
- e.printStackTrace();
+ } catch (Exception e) {
+ log ("Session: "+keys[i]+"; "+e.toString());
+ try {
+ remove(keys[i]);
+ } catch (IOException e2) {
+ log (e2.toString());
+ e2.printStackTrace();
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]