Service Registry 3.1 版本說明

6463868︰使用 JDK 1.6 的用戶端程式或伺服器導致錯誤

問題摘要︰如果在 JDK 1.6 環境中執行 JAXR 用戶端程式,或將 Service Registry 部署在執行 JDK 1.6 的系統上,當程式執行查詢或發佈作業時,便會發生執行階段錯誤。根本問題在於 JDK 1.6 使用 1.3 版本的 SOAP with Attachments API for Java (SAAJ),而 Application Server 使用 1.2 版本。

解決方法:需要兩種類型的解決方法,一種用於用戶端系統,另一種用於伺服器。

Procedure執行用戶端系統解決方法

如果用戶端系統執行的是 JDK 1.6,則需要使用用戶端系統解決方法。該解決方法涉及以下作業︰

  1. 請確保類別路徑中包含以下 JAR 檔案︰

    在 Solaris 作業系統上︰

    /usr/share/lib/saaj-api.jar
    /usr/share/lib/saaj-impl.jar

    在 Linux 和 HP-UX 系統上︰

    /opt/sun/share/lib/saaj-api.jar
    /opt/sun/share/lib/saaj-impl.jar

    例如,如果 Linux 系統的 Ant 目標包含以下設定,則類別路徑正確︰

    <path id="classpath">
      <fileset dir="/opt/sun/share/lib">
        <include name="*.jar"/>
      </fileset>
      ...
    </path>
  2. 將以下 <sysproperty> 標籤增加至 build.xml 檔案的 <java> 目標:

    <sysproperty key="javax.xml.soap.MessageFactory" 
       value="com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"/>
    <sysproperty key="javax.xml.soap.MetaFactory" 
       value="com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl"/>
    <sysproperty key="javax.xml.soap.SOAPConnectionFactory" 
       value="com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory"/>
    <sysproperty key="javax.xml.soap.SOAPFactory" 
       value="com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl"/>

Procedure執行伺服器系統解決方法

伺服器系統解決方法涉及以下作業︰

  1. 變更至 Application Server lib 目錄。

    在 Solaris 作業系統上︰cd /opt/SUNWappserver/appserver/lib

    在 Linux 和 HP-UX 系統上︰cd /opt/sun/appserver/lib

  2. 在 Application Server lib 目錄中建立兩個 SAAJ JAR 檔案的備份副本。例如:


    cp saaj-api.jar saaj-api.jar.v1.2
    cp saaj-impl.jar saaj-impl.jar.v1.2
    
  3. 將 SAAJ 1.3 JAR 檔案複製到 Application Server lib 目錄。

    在 Solaris 作業系統上︰


    cp /usr/share/lib/saaj-api.jar .
    cp /usr/share/lib/saaj-impl.jar .
    

    在 Linux 和 HP-UX 系統上︰


    cp /opt/sun/share/lib/saaj-api.jar .
    cp /opt/sun/share/lib/saaj-impl.jar .
    
  4. 「Service Registry 3.1 Administration Guide」中的「To Use the Application Server Admin Console」所述,登入 Application Server Admin Console。

  5. 展開配置節點。

  6. 展開伺服器節點 server-config (Admin Config)

  7. 按一下 [JVM 設定]。

  8. 按一下 [JVM 選項] 標籤。

  9. 按一下 [增加 JVM 選項]。

  10. 在文字欄位,鍵入以下內容︰


    -Djavax.xml.soap.MessageFactory=com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl
    
  11. 再按一下 [增加 JVM 選項]。

  12. 在文字欄位,鍵入以下內容︰


    -Djavax.xml.soap.MetaFactory=com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl
    
  13. 按一下 [儲存]。

  14. 依照「Service Registry 3.1 Administration Guide」中的「To Stop and Restart the Application Server Domain for the Registry」中的說明進行操作。