File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAXB Unmarshalling XNIException: unexpected root element function-set

 
Gareth Western
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic