This content has been marked as final. Show 4 replies
You have to deploy a set of classes in the original package, with serialVersionUIDs equal to the old ones, and with readResolve() methods that map the old classes to the new ones.
So basically there is no clean way to do it? I understand that the problem shouldn't occur in the first place (good planning lends itself to not reorganizing code). From what you're saying though, it seems as if re-routing object reads are done with hardcoded empty classes - as opposed to ideally taking care of it in the local spot in which it's called.
If there is no way to take care of it at the spot of the object read (the line where the classCastException occurs), then my question has been answered, but if there is I would like to know it.
So there is no clean way to do it?That is the 'clean way to do it.
ideally taking care of it in the local spot in which it's calledImpossible, because the object can't be deserialized unless the class that serialized it is present. Your notion of 'ideal' notwithstanding.
I didn't understand why it was impossible until that last reply - for some reason it sank in.
Thanks for your time and help,