I in our project we have a refactoring of package structure recently. Now the thing is that we have blobs in the table and templates that refer to earlier package structure. and now its giving SerializationException while reading blob which stores Serialized objects in it. What should be the best way to handle and update this exception?
"If a serializable class does not explicitly declare a serialVersionUID, then the serialization runtime will calculate a default serialVersionUID value for that class based on various aspects of the class, as described in the Java(TM) Object Serialization Specification. However, it is strongly recommended that all serializable classes explicitly declare serialVersionUID values, since the default serialVersionUID computation is highly sensitive to class details that may vary depending on compiler implementations, and can thus result in unexpected InvalidClassExceptions during deserialization. Therefore, to guarantee a consistent serialVersionUID value across different java compiler implementations, a serializable class must declare an explicit serialVersionUID value. It is also strongly advised that explicit serialVersionUID declarations use the private modifier where possible, since such declarations apply only to the immediately declaring class--serialVersionUID fields are not useful as inherited members." -- Serializable
Actually the issue is that in my DB I have blob that refers to class location with some different classpath say "A.b.c.myclass.java" and after the code has been refactored the location for myclass.java has been changed to "d.g.f.myclass.java" so while data fetched from DB tried to find "A.b.c.myclass.java" which is not there now as its new location is "d.g.f.myclass.java" and hence giving me SerializationException. So what is the best way to handle this exception in this case.