【发布时间】:2013-08-25 19:00:07
【问题描述】:
在我的 Java 程序中,我创建了一个使用 XOM 读取 XML 文件的类。我也在使用弹簧。当线:
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 文件。我该如何纠正这个问题?
【问题讨论】: