| Summary: | Objects serialized and persisted to MongoDB may not be in the classloader of the MongoSessionHandler, causing ClassNotFoundException | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | David Seymore <david.seymore> | ||||
| Component: | other | Assignee: | Jesse McConnell <jesse.mcconnell> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | unspecified | ||||||
| Target Milestone: | 7.5.x | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
David Seymore
The other problem I am seeing I just pinned down to the ByteArrayOutputStream and ObjectOutputStream being passed around as parameters to the encodeName method. Even when the reset is called the objects saved into mongodb do not deserialize back into the class that the byte array is supposed to represent. My change is: Line 408: From: protected Object encodeName(ObjectOutputStream out, ByteArrayOutputStream bout, Object value) throws IOException To: protected Object encodeName(Object value) throws IOException Line 424: From: o.append(encodeName(entry.getKey().toString()),encodeName(out,bout,entry.getValue())); To: o.append(encodeName(entry.getKey().toString()),encodeName(entry.getValue())); And then on Line 431, I instantiated a fresh set of outputstreams: ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(bout); Now the classes going into mongodb are the same when they come out. Created attachment 210443 [details] Patch generated against the 8.1.0.v20120127 tag AFTER change in bug 370368 Here is a patch that contains both fix for issue describe in title of this ticket and the change to use of newly instantiated output streams per call to encode. Applied, thanks much. Since your on a roll I figured I would link you this: http://wiki.eclipse.org/Jetty/Contributor/Contributing_Patches It makes the easiest to apply patches and gives you credit within our git system. Gerrit is fast approaching as well. :) anyway, much appreciate the contributions! |