繁体   English   中英

org.apache.xerces.jaxp.DocumentBuilderFactoryImpl与javax.xml.parsers.DocumentBuilderFactory不兼容

[英]org.apache.xerces.jaxp.DocumentBuilderFactoryImpl incompatible with javax.xml.parsers.DocumentBuilderFactory

当我尝试在WAS8.0中启动应用程序时遇到以下问题。

[

12/5/13 16:01:53:633 GMT] 00000010 ContextLoader I org.springframework.web.context.ContextLoader initWebApplicationContext Root WebApplicationContext: initialization started
[12/5/13 16:01:53:736 GMT] 00000010 XmlWebApplica I org.springframework.context.support.AbstractApplicationContext prepareRefresh Refreshing Root WebApplicationContext: startup date [Thu Dec 05 16:01:53 GMT 2013]; root of context hierarchy
[12/5/13 16:01:53:821 GMT] 00000010 XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions Loading XML bean definitions from class path resource [XXX.xml]
[12/5/13 16:01:53:858 GMT] 00000010 ContextLoader E org.springframework.web.context.ContextLoader initWebApplicationContext Context initialization failed
                                 org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [XXX.xml]; nested exception is java.lang.ClassCastException: <b>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl incompatible with javax.xml.parsers.DocumentBuilderFactory</b>
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)

确保将最新版本的Xerces带入类路径。 DocumentBuilderFactoryImpl实现javax.xml.parsers.DocumentBuilderFactory所示的位置

正如@Augusto所说,请确保您也没有Xerces的多个版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM