weblogic上部署項目出錯
阿新 • • 發佈:2017-12-29
source 項目 acc progress xml命名空間 error end 引入 b-
一、
2017-12-29 17:46:52,891 ERROR org.springframework.web.context.ContextLoader 331 - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [application-context.xml]; nested exception is java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to javax.xml.parsers.DocumentBuilderFactory
這個是因為maven引入的xml-apis.jar包和weblogic中jar包中有類沖突,所以排除掉這個包即可,在maven的pom中加入配置如下
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
或者在發布的war包中刪除xml-apis.jar文件
weblogic上部署項目出錯