I was able to successfully marshal an object into XML, but when trying
to unmarshal that file back into my Java object, I get the following
error:

No unmarshaller for element"{namespace:ns}FormB" (line 2, col 35)

FormB is the root element.

I'm using the following code to read xml:

    public static Project readFrom(File f) throws JiBXException, IOException{
        IBindingFactory bfact = BindingDirectory.getFactory(Project.class);
        IUnmarshallingContext uctx = bfact.createUnmarshallingContext();

        FileInputStream file = new FileInputStream(f);

        Object obj = uctx.unmarshalDocument(file, null, "UTF-8");   //
this is where error occurs

        Project model = (Project) obj;
        model.setFile(f);
        return model;
    }

Any suggestions?


-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to