More on java.io.NotSerializableException debugging

Posted February 12, 2007 by Alastair

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.

Post Details

  • Post Title: More on java.io.NotSerializableException debugging
  • Author: Alastair
  • Filed As: Apache Wicket, Java
  • Tags:
  • You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Opinion has been expressed on “More on java.io.NotSerializableException debugging”. What is your opinion?

  1. Eelco Hillenius commented:

    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.

Leave a Reply