CXF发布到weblogic问题

服务器端问题
1.javax.jws.webService.portName 找不到的错误
打开bea/weblogic 92/common/bin/commEnv.cmd或commEnv.sh
CLASSPATH后加入
%WL_HOME%\server\lib\geronimo-ws-metadata_2.0_spec-1.1.2.jar
并把geronimo-ws-metadata_2.0_spec-1.1.2.jar包放入bea/weblogic 92/server/lib下

2.java.lang.UnsupportedOperationException: This class does not support SAAJ 1.1
javax.xml.ws.WebServiceException: java.lang.UnsupportedOperationException: This class does not support SAAJ 1.1
Caused by: java.lang.UnsupportedOperationException: This class does not support SAAJ 1.1
1)打开startWebLogic.cmd或startWebLogic.sh文件
2)把saaj的相关包放入工程lib目录,saaj-api-1.3.jar, saaj-impl-1.3.2.jar
3)在set JAVA_OPTIONS=%SAVE_JAVA_OPTIONS%的下一行加入以下语句
set JAVA_OPTIONS=%JAVA_OPTIONS% -Djavax.xml.soap.MessageFactory=com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl

 

weblogic 上调用cxf 客户端时可能出现的问题:
1.javax.xml.stream.supportDTD 找不到的错误
方案1、加入以下系统变量
static {   
    System.setProperty("javax.xml.stream.XMLInputFactory",   
      "com.ctc.wstx. stax .WstxInputFactory");   
    System.setProperty("javax.xml.stream.XMLOutputFactory",   
      "com.ctc.wstx.stax .WstxOutputFactory");   
    System.setProperty("javax.xml.stream.XMLEventFactory",   
      "com.ctc.wstx.stax .evt.WstxEventFactory");   
}

 

方案2、让应用程序lib优先加载


2、\bea\weblogic 92\server\lib\consoleapp\META-INF\weblogic -application.xml 中加入:
     <!-- 2011-6-7 linjun -->
     <package-name>javax.jws.*</package-name>
  <package-name>javax.xml.soap.*</package-name>
  <package-name>javax.xml.stream.*</package-name>
  <package-name>javax.xml.stream.events.*</package-name>
  <package-name>javax.xml.stream.util.*</package-name>

3、java.lang.ClassCastException: com.ctc.wstx.stax .WstxInputFactory,经CH验证,删去工程中引入的wstx-asl-3.2.9.jar

你可能感兴趣的:(weblogic)