• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB Unmarshalling XNIException: unexpected root element function-set  RSS feed

 
Gareth Western
Ranch Hand
Posts: 45
  • 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
  • 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
  • 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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!