WOXMLCoder/decoder bug with optional to-one relations?
WOXMLCoder/decoder bug with optional to-one relations?
- Subject: WOXMLCoder/decoder bug with optional to-one relations?
- From: Shrisha Radhakrishna <email@hidden>
- Date: Fri, 16 May 2003 12:54:11 -0700
Hi there,
I'm having a hard time decoding XML back into an EO that has an
optional to-one relation. The encoding works fine (well, not strictly,
I think) and the decoding fails with a
Java.lang.IllegalArgumentException: Array is Empty.
For example, consider two entities, A and B where A has a nullable
to-one into B.
XML Encoding produces:
<A type="com.abc.xyx.A" objectID="1">
<attribute1 type="java.lang.String" objectID="2">value1</attribute1>
<attribute2 type="java.lang.String" objectID="3">value2</attribute2>
<relation1 type="relationship" relationshipType="to-one">
</relation1>
</PeBillingTerm>
In my mind, the relation1 tag shouldn't even be present if the relation
is not present in the DB/EditingContext. Thoughts?
Anyway, on the decoding side, I get the same XML; but, decoding fails
with:
com.webobjects.appserver.xml.WOXMLException for
java.lang.IllegalArgumentException: Array is empty
at com.webobjects.foundation.NSArray.objectAtIndex(NSArray.java:488)
at
com.webobjects.appserver.xml.WOXMLDecoder.decodeObjectForKey(WOXMLDecode
r.java:752)
at
com.webobjects.appserver.xml.WOXMLDecoder._decodeEO(WOXMLDecoder.java:52
4)
at
com.webobjects.appserver.xml.WOXMLDecoder.decodeObjectForKey(WOXMLDecode
r.java:815)
at
com.webobjects.appserver.xml._private._DecodingHandler.root(_DecodingHan
dler.java:31)
at
com.webobjects.appserver.xml.WOXMLDecoder.decodeRootObject(WOXMLDecoder.
java:706)
Looks like the decoder is trying to go into "relation1" and expecting
to see a back-reference? Still beats me why it's looking for an Array
though.
I did come across a similar problem posted on Radar. Check out:
http://developer.apple.com/techpubs/webobjects/ReleaseNotes/
WO52RelNotes/chapter_1_section_14.html
Radar # 2574754. Wonder if this is indeed the same issue I'm seeing
and whether there is a fix? I can't afford to use mapping files due to
the sheer number of entities in my project.
I'm very new to apple and webobjects; so, please bear with me while I
get all the nomenclature right.
Thanks,
Shrisha
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.