marshel and unmarshel with jaxb?

Discussion in 'Java' started by Elhanan, Feb 17, 2006.

  1. Elhanan

    Elhanan Guest

    i'm trying to use jaxb with eclipse , I have allready generated the
    classes and they are ok but if try :
    final JAXBContext
    Marshaller ms=context.createMarshaller();

    DocumentBuilderFactory f =
    DocumentBuilder b= f.newDocumentBuilder();
    Document d = b.parse("test001.xml");
    // Unmarshall the document

    final RespParty respParty = (RespParty)

    - with linked exception:
    [org.xml.sax.SAXParseException: unexpected root element (uri:"",
    local:"party"). Expected elements are <{}party>]

    so instead of using the document object, i used a file object and it
    was ok, but, if i try to create a objects and turn it to xml i can't.
    Elhanan, Feb 17, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.