Hi Aidan, There were some changes made to the custom marshalling/unmarshalling interface for 1.2/1.2.1, and I suspect one of these has had an unintended side effect. Please create a Jira bug report and attach your project to that.
I realize there are a lot of Jiras I haven't gone through yet, but will be doing a lot of work on the Jira issues next week in preparation for the 1.2.2 release. - Dennis Dennis M. Sosnoski XML and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 aidano wrote: > 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 > > > ------------------------------------------------------------------------------ Are you an open source citizen? Join us for the Open Source Bridge conference! Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users