weblogic上部署项目出错

一、

Unable to access the selected application.
Exception in AppMerge flows' progression
Exception in AppMerge flows' progression
Unmarshaller failed
网上各种方法,我这问题出现在weblogic.xml命名空间上,估计是这个命名空间有问题,找了之前的,虽然是错的,也解决掉了
出错的xml:
<wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
修改后:
<wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
二、这个问题是之前没有用maven时候在weblogic上还可以,后来改为maven项目就出错了

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文件
原文地址:https://www.cnblogs.com/hujiapeng/p/8145708.html