gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 11:25:11 26 4
gpt4 key购买 nike

当我尝试在 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,如图 here .

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

关于java - org.apache.xerces.jaxp.DocumentBuilderFactoryImpl 与 javax.xml.parsers.DocumentBuilderFactory 不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20404951/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com