I get an unmarshalling error when I have a mapping in which a <VALUE>
element comes after a <COLLECTION> element.

This mapping does not work.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE binding SYSTEM "C:\java\jibx\docs\binding.dtd">
<binding>
        <mapping name="WorkLocation"
        
class="com.ibaset.solumina.sffnd.worklocation.WorkLocation"
                extends="com.ibaset.solumina.domain.ObsoletableObject" >

                <value name="workLocation" field="workLocation"></value>
                <value name="locationTitle"
field="locationTitle"></value>
                <value name="obsoleteRecordFlag"
get-method="getObsoleteRecordFlag" set-method="setObsoleteRecordFlag"/>
                <value name="repairStation" field="repairStation" />
                <value name="updateUserId" field="updateUserId" />
                <value name="updateTimestamp" field="updateTimestamp" />
                <collection field="workDepartments"
type="java.util.ArrayList" />
                <value name="ucfWorkLocVch1" field="ucfWorkLocVch1" />
        </mapping>
</binding>

The error is 
org.jibx.runtime.JiBXException: No unmarshaller for element
"ucfWorkLocVch1" (line 1, col 791)
        at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unmarshallin
gContext.java:2535)
        at
com.ibaset.solumina.domain.JiBX_MungeAdapter.JiBX_MasterBinding_unmarsha
l_1_0()
        at
com.ibaset.solumina.sffnd.worklocation.WorkLocation.JiBX_MasterBinding_u
nmarshal_3_1(WorkLocation.java)
        at
com.ibaset.solumina.sffnd.worklocation.JiBX_MasterBindingWorkLocation_ac
cess.unmarshal()
        at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unmarshallin
gContext.java:2538)
        at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unmarshalli
ngContext.java:2681)
        at ObjectToXml.main(ObjectToXml.java:113)

But by moving the line <value name="ucfWorkLocVch1"
field="ucfWorkLocVch1" /> above the collection I no longer get the
error.  Is this a constraint of JiBX?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE binding SYSTEM "C:\java\jibx\docs\binding.dtd">
<binding>
        <mapping name="WorkLocation"
        
class="com.ibaset.solumina.sffnd.worklocation.WorkLocation"
                extends="com.ibaset.solumina.domain.ObsoletableObject" >

                <value name="workLocation" field="workLocation"></value>
                <value name="locationTitle"
field="locationTitle"></value>
                <value name="obsoleteRecordFlag"
get-method="getObsoleteRecordFlag" set-method="setObsoleteRecordFlag"/>
                <value name="repairStation" field="repairStation" />
                <value name="updateUserId" field="updateUserId" />
                <value name="updateTimestamp" field="updateTimestamp" />
            <value name="ucfWorkLocVch1" field="ucfWorkLocVch1" />
                <collection field="workDepartments"
type="java.util.ArrayList" />           
        </mapping>
</binding>

Rick Laird




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to