I have serilaized e lot of document, withoud excluding "class", and therefore ha a lot of json-files with class-info in them.
After refactoring the packages, I am no longer able to deserialize those documents.
I have tried :
FileReader r = new FileReader(new File("/Users/frha.CORP/Downloads/arkiv.json"));
InternalDocument doc = new JSONDeserializer<InternalDocument>().use(null, InternalDocument.class).deserialize(r);
But it still tries to load the 'old' version of InternalDocument in another package than the current.
I have also tried deserializeInto() a new object of the new class, but then it fails on deserializing into objects in a list later on. Because the objects in the list have also been refactored, and stored with old classname.
Why doesn't "use" override what's in the json-stream ?
I did try to manually edit away all "class" -lines in one json-file, and the class loaded just fine... But this is not an option for alle the old ocuments stored...
Last edit: Frode Halvorsen 2014-01-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have serilaized e lot of document, withoud excluding "class", and therefore ha a lot of json-files with class-info in them.
After refactoring the packages, I am no longer able to deserialize those documents.
I have tried :
FileReader r = new FileReader(new File("/Users/frha.CORP/Downloads/arkiv.json"));
InternalDocument doc = new JSONDeserializer<InternalDocument>().use(null, InternalDocument.class).deserialize(r);
But it still tries to load the 'old' version of InternalDocument in another package than the current.
I have also tried deserializeInto() a new object of the new class, but then it fails on deserializing into objects in a list later on. Because the objects in the list have also been refactored, and stored with old classname.
Why doesn't "use" override what's in the json-stream ?
I did try to manually edit away all "class" -lines in one json-file, and the class loaded just fine... But this is not an option for alle the old ocuments stored...
Last edit: Frode Halvorsen 2014-01-07