在我的Java程序中,我创建了一个使用XOM读取XML文件的类。我也在使用Spring。当执行行:ApplicationContext ctx = new ClassPathXmlApplicationContext("dataIO-beans.xml");时,我得到一个异常,其中包括: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.如果我从Eclipse项目构建路径中删除了dtd-xercesImpl.jar,Spring成功地从xml文件中读取了bean,但是现在我的XML读取类不能工作了,因为XOM需要那个jar文件。我怎样才能纠正这个错误呢?
发布于 2013-08-26 05:42:41
看起来我找到了一个解决方案。我从http://xerces.apache.org/mirrors.cgi下载了Xerces2二进制文件,并将这些JAR文件添加到构建路径中,而不是使用dtd-xercesImpl.jar,这样就可以工作了。
https://stackoverflow.com/questions/18432546
复制相似问题