Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #7672
| Newsgroups | comp.lang.java.programmer |
|---|---|
| From | Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> |
| Subject | Re: De-serializing an object with missing child classes |
| References | <774ae53e-c127-4d79-8267-d8c8197d0dfb@z7g2000vbp.googlegroups.com> <a8c55b80-c7c2-4eaa-90b3-019fffe037ce@a13g2000yqd.googlegroups.com> <9651530b-9ed9-41cc-b686-b0644226a65a@a31g2000vbt.googlegroups.com> <9coeqfFfujU1@mid.individual.net> |
| Message-ID | <slrnj6ema9.6gl.avl@gamma.logic.tuwien.ac.at> (permalink) |
| Date | 2011-09-07 11:45 +0000 |
Robert Klemme <shortcutter@googlemail.com> wrote:
> On 06.09.2011 16:17, raphfrk@gmail.com wrote:
>> Thanks for the info. Is there a way to create a custom deserializer
>> that can deserialize already serialized classes?
> I am not sure I get exactly what you mean here.
I understood it such, that he has got some binary blob that was once
generated from serializing an array containing various implementations
of some common interface (e.g. a Serializable[]).
Since then, for some reason, some class files are "irrecoverably lost"
(or maybe just not shipped in some stripped down distribution of his sw),
and the task is *NOT* to recover those lost classes, but to recover just
those other objects whose .class files are still available. The data for
the instances of the lost classes should just be discarded, and a null
written instead of the actual instance.
The question now is, if a custom deserializer could be made data-compatible
with the standard serializer, and specifically skip the attempt to create
those instances of those unknown classes, instead pretending that a null was
originally saved.
Most likely, however, it could be easier to (re)construct a dummy-class
with name and fields and whatnot of the original class. Maybe it can be
cheated in as a substitute of the original class.
PS: the javadocs explicitly advise against using Serialization for
long-term-storage.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
De-serializing an object with missing child classes "raphfrk@gmail.com" <raphfrk@gmail.com> - 2011-09-06 05:15 -0700
Re: De-serializing an object with missing child classes Robert Klemme <shortcutter@googlemail.com> - 2011-09-06 05:34 -0700
Re: De-serializing an object with missing child classes "raphfrk@gmail.com" <raphfrk@gmail.com> - 2011-09-06 07:17 -0700
Re: De-serializing an object with missing child classes Robert Klemme <shortcutter@googlemail.com> - 2011-09-07 07:46 +0200
Re: De-serializing an object with missing child classes Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-09-07 11:45 +0000
Re: De-serializing an object with missing child classes "raphfrk@gmail.com" <raphfrk@gmail.com> - 2011-09-07 07:17 -0700
Re: De-serializing an object with missing child classes "raphfrk@gmail.com" <raphfrk@gmail.com> - 2011-09-07 07:14 -0700
Re: De-serializing an object with missing child classes Roedy Green <see_website@mindprod.com.invalid> - 2011-09-06 06:04 -0700
Re: De-serializing an object with missing child classes Roedy Green <see_website@mindprod.com.invalid> - 2011-09-06 11:59 -0700
Re: De-serializing an object with missing child classes Arne Vajhøj <arne@vajhoej.dk> - 2011-09-06 19:51 -0400
Re: De-serializing an object with missing child classes markspace <-@.> - 2011-09-06 17:53 -0700
Re: De-serializing an object with missing child classes Arne Vajhøj <arne@vajhoej.dk> - 2011-09-06 19:53 -0400
csiph-web