org.springframework.oxm.jibx.JibxMarshallingFailureException: JiBX marshalling exception: Supplied root object of class java.util.LinkedList cannot be marshalled without top-level mapping; nested exception is org.jibx.runtime.JiBXException: Supplied root object of class java.util.LinkedList cannot be marshalled without top-level mappingAlthough I had all the marshalling beans set up I was passing in a collection instead of the object that JibX was expecting. For example:
Which should have been (see line 3):
ListOfUuids lou = new ListOfUuids () ; lou.setList (export) ; String xml = MarshallerUtils.convertObjectToXML (marshaller, export) ;
An easy mistake to make, but made more difficult to find by not knowing what the error message means!
ListOfUuids lou = new ListOfUuids () ; lou.setList (export) ; String xml = MarshallerUtils.convertObjectToXML (marshaller, lou) ;
Comment from: Vrunda Bapat [Visitor]
I saw your post regarding Marshalling -Unmarshalling via JibX. I am having a similar error and wanted to clarify something. I am having a collection of Objects which I want to marshall/unmarshall. I am getting the context for class :TimeRecord.class and marshalling that same Object and not the collection but it still gives me the same error :Supplied root object of class cannot be marshalled without top-level mapping.
My code: IBindingFactory bfact = BindingDirectory.getFactory(gov.irs.aec.bus.time_entry.entity.Time3081Record);
IMarshallingContext mctx = bfact.createMarshallingContext(); mctx.marshalDocument(time3081Rec, “UTF-8″, null, new FileOutputStream(FILE_NAME));
Can you help me with this error? If you give me your contact mail - I can send you my binding.xmls as well.. Please help!I didn’t see ANY OTHER post than yours.
Comment from: [Member]
You are asking for a Time3081Record marshaller so you must send in a Time3081Record class. Are you sending in a TimeRecord class instead?
Do you have a test case of it not working?
Comment from: vibhu [Visitor]
Comment from: Veerendra [Visitor]
Form is loading...