Webservice(CXF) 、 POI(excel)操作部署到weblogic上沖突解決


這幾日把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,這個網址上也說的很清楚

http://forum.spring.io/forum/spring-projects/container/13517-java-lang-classcastexception-weblogic-xml-jaxp-registrydocumentbuilderfactory

 

沖突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包刪除,解決問題


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM