[serialization] unregistered_class exception that wasn't occurring before
Hello,
I'm serializing the following type:
(pseudo-definition)
multi_index_container<
variant<
shared_ptr
It works well when I make and load archives with the current version of my app, but when I try to open an archive made by the pervious version it throws unregistered_class for one of my classes. The both versions use boost 1.47, and the differences between them seem to me absolutely unrelated to serialization (as far as I can see). Unfortunately I can't provide here code snippets, so my question is theoretical: what could break the backward compatibility in such a way? What should I look into? Thanks.
Igor R wrote:
Hello,
I'm serializing the following type: (pseudo-definition) multi_index_container< variant< shared_ptr
, shared_ptr , etc... It works well when I make and load archives with the current version of my app, but when I try to open an archive made by the pervious version it throws unregistered_class for one of my classes. The both versions use boost 1.47, and the differences between them seem to me absolutely unrelated to serialization (as far as I can see).
Unfortunately I can't provide here code snippets, so my question is theoretical: what could break the backward compatibility in such a way? What should I look into?
Thanks.
Igor R wrote:
It works well when I make and load archives with the current version of my app, but when I try to open an archive made by the pervious version it throws unregistered_class for one of my classes.
was the "previous version" made with the same version of the serialization library?
The both versions use boost 1.47, and the differences between them seem to me absolutely unrelated to serialization (as far as I can see).
What are the differences? If the previous version didn't serialize via a pointer and the current one does, this could happen. Otherwise I wouldn't expect this. Robert Ramey
Unfortunately I can't provide here code snippets, so my question is theoretical: what could break the backward compatibility in such a way? What should I look into?
Thanks.
was the "previous version" made with the same version of the serialization library?
As I mentioned, the both versions were built with boost 1.47.
What are the differences? If the previous version didn't serialize via a pointer and the current one does, this could happen. Otherwise I wouldn't expect this.
The serialization code didn't change at all. In the both versions it
serializes the structure I described in the previous message. The
classes changed a bit, but I can't realise how it could affect the
serialization.
The xml item made by the previous version look like this:
<item>
<which>5</which>
<value class_id="64" tracking_level="0" version="1">
<px class_id="65" tracking_level="1" version="0" object_id="_116">
<info>etc...
The same item from an archive made by the new version:
<item>
<which>5</which>
<value class_id="84" tracking_level="0" version="1">
<px class_id="85" tracking_level="1" version="0" object_id="_84">
<info>etc...
When it comes to
Igor R wrote:
The serialization code didn't change at all.
maybe - but the what could change is the following. Som class might now being doing ar < p where p is a pointer where as before this was never done. This would affect the archive even without changing the serialization code itself. Look for that. Robert Ramey
In the both versions it serializes the structure I described in the previous message. The classes changed a bit, but I can't realise how it could affect the serialization. The xml item made by the previous version look like this: <item> <which>5</which> <value class_id="64" tracking_level="0" version="1"> <px class_id="65" tracking_level="1" version="0" object_id="_116"> <info>etc...
The same item from an archive made by the new version: <item> <which>5</which> <value class_id="84" tracking_level="0" version="1"> <px class_id="85" tracking_level="1" version="0" object_id="_84"> <info>etc...
When it comes to
, i.e. to the raw ptr within the shared_ptr<>, it can't find the class. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Igor R
-
Robert Ramey