More on java.io.NotSerializableException debugging

Eelco took my original ten minute hack and ran with it, and has produced something that covers a lot more edge cases. It handles anonymous inner classes, externalizables, things with custom writeObject() functions and a bunch of other stuff. It also plays nicely with SecurityManagers. You can find the code in Wicket 1.3’s SerializableChecker.java. It has a couple of custom Wicket bits, but would be completely trivial to strip those out if you wanted to use this somewhere else. At about 700 lines, it’s a bit more complicated than we both expected it to be, but it’s pretty robust. Good work Eelco! ;-)

– UPDATE –
Bob Lee has a different way of doing this.

This entry was posted in Apache Wicket, Java. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Comment

  1. Posted March 30, 2007 at 1:08 am | Permalink

    Though Bob Lee’s entry is a lot more elegent, unfortunately, it doesn’t cover our cases well, particularly because his solution only gives classes, not field names. After some investigation, I decided to keep our old stuff.

Post a Comment

Your email is never published nor shared.