Can anyone help with this? I have fully runnable example code which I can send to anyone interested.
The code works fine with versions 1.1.5 and 1.1.6a of Jibx. Changing the Jibx version to > 1.2, causes things to break with the following error message: java.lang.RuntimeException: org.jibx.runtime. JiBXException: Expected "{http://www.edmunds.com/esbservices/schemas}features" end tag, found "{http://www.edmunds.com/esbservices/schemas}usedFeature" start tag (line 36, col 12) at com.jibxtest.JibxTest.test(JibxTest.java:36) Caused by: org.jibx.runtime.JiBXException: Expected "{http://www.edmunds.com/esbservices/schemas}features" end tag, found "{http://www.edmunds.com/esbservices/schemas}usedFeature" start tag (line 36, col 12) at org.jibx.runtime.impl.UnmarshallingContext.parsePastCurrentEndTag(UnmarshallingContext.java:736) at com.jibxtest.Style.JiBX_jibx_bindings_unmarshal_1_0(Style.java) at com.jibxtest.JiBX_jibx_bindingsStyle_access.unmarshal() at com.jibxtest.JiBX_MungeAdapter.JiBX_jibx_bindings_unmarshal_1_1() at com.jibxtest.ModelYear.JiBX_jibx_bindings_unmarshal_1_0(ModelYear.java) at com.jibxtest.JiBX_jibx_bindingsModelYear_access.unmarshal() at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2762) at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2905) at com.jibxtest.JibxTest.test(JibxTest.java:29) ... 29 more The piece of XML in question is the following: <vdm:style id="100392461" name="style1"> <vdm:features> <vdm:option ref="100854741"/> <vdm:option ref="100854742"/> <vdm:option ref="100854743"/> <vdm:usedFeature ref="TMVU1005042044610000017"/> </vdm:features> </vdm:style> and the bindings for these elements are as follows: <mapping ns="http://www.edmunds.com/esbservices/schemas" class="com.jibxtest.Style" name="style"> <value style="attribute" name="id" field="id" type="java.lang.Long" usage="required"/> <structure name="features" field="features" usage="optional" map-as="features-set"/> </mapping> <mapping abstract="true" type-name="features-set" class="java.util.Set" create-type="java.util.HashSet"> <collection usage="optional" ordered="false"> <structure name="option" type="com.jibxtest.Option" marshaller="com.jibxtest.FeatureIdRefMapper" unmarshaller="com.jibxtest.FeatureIdRefMapper"/> <structure name="usedFeature" type="com.jibxtest.UsedFeature" marshaller="com.jibxtest.FeatureIdRefMapper" unmarshaller="com.jibxtest.FeatureIdRefMapper"/> </collection> </mapping> The vdm:option and vdm:usedFeature elements have been previously defined in the XML under another parent element, and I'm using a custom IdDefRefMapper implementation to use the original object when it's picked up in the style element's vdm:features collection. The classes that represent options and usedFeatures both subclass a Feature base class. The mapping is based on this original advice: http://www.nabble.com/Un-Marshalling-different-object-types-in-collection-using-custom-IdDefRefMapperBase-not-working-td15238713.html#a15250097 Can anyone please tell me how I can fix this in the latest version, or suggest an alternate method of marshalling collections containing more than one type? thanks, Aidan -- View this message in context: http://www.nabble.com/Issue-with-binding-file-after-upgrading-from-1.1.5--%3E-1.2.1-tp23784598p24007849.html Sent from the jibx-users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users