Supplied root object of class * cannot be marshalled without top-level mapping
4 comments
Comment from: Vrunda Bapat [Visitor]
Comment from: davidnewcomb [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]
Thanx… I was stuck at the same problem and this nailed it
Comment from: Veerendra [Visitor]
This exception root cause is, you are passing object to JIBX marshalDocument method is not root element class object of jibx xml configuration,
surely your configured xml root element class is not TimeRecord java class.
Form is loading...
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.