• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
XMLserializing with NSData, need Help !
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XMLserializing with NSData, need Help !


  • Subject: XMLserializing with NSData, need Help !
  • From: Amedeo Mantica <email@hidden>
  • Date: Tue, 16 May 2006 00:09:35 +0200

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!
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: NSTimestampFormatter DECREMENTING 'day' on each pass
  • Next by Date: Re: NSTimestampFormatter DECREMENTING 'day' on each pass
  • Previous by thread: Re: NSTimestampFormatter DECREMENTING 'day' on each pass
  • Next by thread: Best Way to communicate with Tomcat
  • Index(es):
    • Date
    • Thread