Bug 19034 - InvalidClassException in StoreBase.java
Summary: InvalidClassException in StoreBase.java
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Catalina:Modules (show other bugs)
Version: 4.1.27
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords: ErrorMessage, PatchAvailable
: 22716 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-04-15 15:18 UTC by Ronald Klop
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)



Attachments
Catch exception and remove sessions from Store. (1.10 KB, patch)
2003-04-15 15:19 UTC, Ronald Klop
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ronald Klop 2003-04-15 15:18:55 UTC
If classes change StoreBase throws an InvalidClassException. I think the best
way to solve this is to log the error and than remove the session from the
Store, because the session is invalid anyway.
I will attach a patch.
Comment 1 Ronald Klop 2003-04-15 15:19:34 UTC
Created attachment 5837 [details]
Catch exception and remove sessions from Store.
Comment 2 Ronald Klop 2003-04-15 15:22:22 UTC
Sorry, used tabs in stead of spaces. Can the committer change this?
Comment 3 Remy Maucherat 2003-04-15 15:49:35 UTC
Do you mean: if class changes to a different incompatible serialization format ?
Comment 4 Ronald Klop 2003-04-16 09:17:46 UTC
Yes, I mean changes in the serialization format.
The ClassNotFoundException can/should probably be handled the same way.

2003-04-15 13:02:44 JDBCStore[]: java.io.InvalidClassException:
nl.base.progs.User; local class incompatible: stream classdesc serialVersionUID
= -11535525597440569, local class serialVersionUID = -635923919362335785

Because the sessions are not removed. I get a lot of exceptions with stacktraces
every time the sessions are loaded from the database.
Comment 5 Ronald Klop 2003-09-09 14:48:50 UTC
If there is an InvalidClassException in load(keys[i]) in
StoreBase.processExpires the session will never expire, because the code which
checks for expiration is never reached.
Valid sessions will not expire also, because the loop is ended by the exception.
Comment 6 Ronald Klop 2003-09-09 15:16:05 UTC
Two more things.
1. Sessions which get a ClassNotFoundException while loading from the Store can
probably be removed also.
2. I don't know if the InvalidClassException should be catched on more places.
Comment 7 Mark Thomas 2004-05-22 22:24:39 UTC
*** Bug 22716 has been marked as a duplicate of this bug. ***
Comment 8 Mark Thomas 2004-05-22 23:25:36 UTC
I have committed a slightly modified patch - one that catches any exception - 
to TC4 and TC5.

Many thanks.