Conflict between Spring and XOM

2.9k views Asked by At

In my Java program, I made a class that uses XOM to read XML files. I am also using Spring. When the line: ApplicationContext ctx = new ClassPathXmlApplicationContext("dataIO-beans.xml"); is executed, I get an exception that includes: javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@4d48f152] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support. If I remove dtd-xercesImpl.jar from the Eclipse project build path, Spring successfully reads the bean from the xml file, but now my XML reading class doesn't work because XOM needs that jar file. How can I correct this?

1

There are 1 answers

0
korshyadoo On

Looks like I found a solution. I downloaded the Xerces2 binaries from http://xerces.apache.org/mirrors.cgi and added those JARs to the build path instead of using the dtd-xercesImpl.jar and it worked.