Hi.
We have a production system that uses a lot of Serialization. What be basically do is store an object called ProcessData in the jbpm database as byte array. Thus this is serialized.
Consider the following Object.
public class ProcessData implements Serializable {
private static final long serialVersionUID = -4859440951531011062L;
public void getX() {
//not important
}
}
Now lets say we have this object stored in the JBPM database as byte array and we are using this in production.
Now later we want to upgrade this ProcessData object with a new data
public class ProcessData implements Serializable {
private static final long serialVersionUID = -4859440951531011062L;
public void getX() {
//not important
}
public void getY() {
//not important
}
}
Now the problem is when JBPM loads the old
stored ProcessData object, we get an exception
Caused by: java.io.InvalidClassException: my.package.ProcessData; local class incompatible: stream classdesc serialVersionUID = 6651422488035743444, local class serialVersionUID = -7966721901330644987
Now my question is, how can we solve this problem? How can we make read the serialized object and sort of transform it in this new class. Is it even possible? Remember that we have limited control over the JBPM library.