aspose file tools*
The moose likes XML and Related Technologies and the fly likes JAXB Unmarshalling XNIException: unexpected root element function-set Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JAXB Unmarshalling XNIException: unexpected root element function-set" Watch "JAXB Unmarshalling XNIException: unexpected root element function-set" New topic
Author

JAXB Unmarshalling XNIException: unexpected root element function-set

Gareth Western
Ranch Hand

Joined: Apr 07, 2004
Posts: 45
I'm trying to validate and unmarshall an xml document using JDK5. The code is as follows:

But I'm getting the following error:

I'm using Java 1.5.0_12, with JAXB 2.1.3 and Xerces 2.9.1, and passing in the following Java options to use the Xerces SAX Parser: -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl

The program works correctly using Java 6, which already has JAXB and Xerces included with it. What am I doing wrong with Java 5?
Gareth Western
Ranch Hand

Joined: Apr 07, 2004
Posts: 45
Nevermind. I've managed to get my example working with JDK5 in a clean project, therefore it must be a classpath issue...
Gareth Western
Ranch Hand

Joined: Apr 07, 2004
Posts: 45
Solved it. I think it was related to some files created by an older version of JAXB still lying in the classpath (jaxb.properties? bgm.ser?).

phew!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAXB Unmarshalling XNIException: unexpected root element function-set