I was trying to get an app working standalone a spring application context via the classpath. In eclipse it worked fine but at the command line I got:
Unable to validate using XSD: Your JAXP provider [org.apache.crimson.jaxp.DocumentBuilderFactoryImpl @148cc8c] does not support XML Schema. Are you running on Java 1.4 or below with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support.
I was using java 1.6 and the latest Xerces so this error message is not at all helpful. What was VERY helpful was finding the thread at http://forum.springsource.org/archive/index.php/t-21140.html which contained the answer. I need to define a couple of properties that force the factories for XML parsing. Just add the following as JVM parameters:
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
4 comments:
Thank you very much for posting this. I see that you posted this in 2009... well, almost five years later, in 2014, it really helped me to solve the same issue I was having with Spring Framework. Thanks again. Brett
Thank you very much. You saved me!!
Thankyou
Finding this was well-timed! It works even through Java 8-compliant projects. Thanks again!
Post a Comment