Have you compiled and run the code? Or have thought and wrote it hereonly. Cause I think it still contains errors. Besides of doing allthis stuff, there will be again the well knownException "NotSerializableException" will welcome you.