这几日把webservice和POI 操作部署到WebLogic上,问题重重,有各种冲突。
部署到tomcat上没有问题
版本:
jdk:6
tomcat:6
weblogic:10.3.3
cxf:2.6
poi:3.9
冲突1:
org.apache.cxf.binding.soap.SoapFault: Cannot create a secure XMLInputFactory
在WEB-INF文件夹下,加上weblogic.xml
<?xml version="1.0" encoding="UTF-8" ?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web- app.xsd">
<container-descriptor>
<index-directory-enabled>true</index-directory-enabled>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
冲突2:
java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory at javax.xml.parsers.DocumentBuilderFactory
jar包冲突导致,网上的资料大都说是xml-apis 冲突,从war包里删除掉xml-apis,这个网址上也说的很清楚
冲突3:
java.lang.LinkageError: loader constraint violation: loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader)
previously initiated loading for a different type with name "javax/xml/namespace/QName"
也是jar包与WebLogic冲突,这次冲突的是stax的 stax-api,删除
冲突4:
java.lang.LinkageError: loader constraint violation: when resolving interface method "org.w3c.dom.Node.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/apache/cxf/staxutils/StaxUtils, and the class loader (instance of ) for resolved class, org/w3c/dom/Node, have different Class objects for the type erDataHandler;)
包冲突,将xmlbeans包删除,解决问题