hello, i got this error during deserialization:
java.lang.ClassCastException: cannot assign instance of java.lang.String to field imageGallery.fileData of type com.webobjects.foundation.NSData in instance of imageGallery
Serialization works fine, if i see the XML file i got correct class definitions...
<object id="14" ignoreEDB="1" key="fileData"> <class flag="3" id="12" name="com.webobjects.foundation.NSData" suid="-6138488451902188317"> <field name="bytes" type="base64"/> </class> <array field="bytes" id="16" ignoreEDB="1" length="52598" type="base64">/9j/4AAQSkZJRgABAQAAAQABAAD/7QAcUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAD/4gvwSUNDX1BST0ZJTEUAAQEAAAvgYXBwbAIAAABtbnRyUkdCIFhZWiAH1gAEABUAEwAOAAlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWFwcGxIOM+wvg2Igsz6gRKXUmO4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1yWFlaAAABIAAAABRnWFlaAAABNAAAABRiWFlaAAABSAAAABR3dHB0AAABXAAAABRjaGFkAAABcAAAACxyVFJDAAABnAAAAA5nVFJDAAABrAAAAA5iVFJDAAABvAAAAA52Y2d0AAABzAAABhJuZGl
but in the deserializing i got error...
this is the imageGallery class writeObject method:
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { NSXMLOutputStream xml_stream = (NSXMLOutputStream)out; xml_stream.writeObject(fileName(),"fileName"); xml_stream.writeObject(fileMime(),"fileMime"); xml_stream.writeObject(fileData(),"fileData"); }
I need to implement a readObject method? I sincerely don't know how to
note: I don't know if this is important, the class imageGallery is not an EO database class, I wrote the class.
can you help me?? thanks! |