I think you want to extend Externalizable rather than Serializable here.