Problem Summary: If a JAXR client program runs in a JDK 1.6 environment, or if Service Registry is deployed on a system that is running JDK 1.6, runtime errors result when the program performs a query or publish operation. The underlying problem is that JDK 1.6 uses version 1.3 of the SOAP with Attachments API for Java (SAAJ), while Application Server uses version 1.2.
Workaround: There are two types of workarounds required, one for the client system and one for the server.
If the client is running JDK 1.6 and the server is running JDK 1.5, follow the steps in To Perform the Client System Workaround.
If the client is running JDK 1.5 and the server is running JDK 1.6, follow the steps in To Perform the Server System Workaround.
If both the client and server are running JDK 1.6, follow the steps for both workarounds.
The client system workaround is required if the client system is running JDK 1.6. This workaround involves the following tasks:
Adding the SAAJ 1.3 JAR files to the classpath if they are not already present
Setting four system properties in the Ant build file for the client program
Make sure that your classpath includes the following JAR files:
On Solaris OS:
/usr/share/lib/saaj-api.jar /usr/share/lib/saaj-impl.jar
On Linux and HP-UX systems:
/opt/sun/share/lib/saaj-api.jar /opt/sun/share/lib/saaj-impl.jar
For example, if your Ant targets for a Linux system include a setting like the following, your classpath is correct:
<path id="classpath"> <fileset dir="/opt/sun/share/lib"> <include name="*.jar"/> </fileset> ... </path>
Add the following <sysproperty> tags to the <java> targets in your build.xml files:
<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"/>
The server system workaround involves the following tasks:
Putting the SAAJ 1.3 JAR files in the Application Server lib directory
Adding two JVM options to set system properties
Stopping and restarting Application Server
Change to the Application Server lib directory.
On Solaris OS: cd /opt/SUNWappserver/appserver/lib
On Linux and HP-UX systems: cd /opt/sun/appserver/lib
Make backup copies of the two SAAJ JAR files in the Application Server lib directory. For example:
cp saaj-api.jar saaj-api.jar.v1.2 cp saaj-impl.jar saaj-impl.jar.v1.2 |
Copy the SAAJ 1.3 JAR files to the Application Server lib directory.
On Solaris OS:
cp /usr/share/lib/saaj-api.jar . cp /usr/share/lib/saaj-impl.jar . |
On Linux and HP-UX systems:
cp /opt/sun/share/lib/saaj-api.jar . cp /opt/sun/share/lib/saaj-impl.jar . |
Log in to the Application Server Admin Console as described in To Use the Application Server Admin Console in Service Registry 3.1 Administration Guide.
Expand the Configurations node.
Expand the server node, server-config (Admin Config).
Click JVM Settings.
Click the JVM Options tab.
Click Add JVM Option.
In the text field, type the following:
-Djavax.xml.soap.MessageFactory=com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl |
Click Add JVM Option again.
In the text field, type the following:
-Djavax.xml.soap.MetaFactory=com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl |
Click Save.
Follow the instructions in To Stop and Restart the Application Server Domain for the Registry in Service Registry 3.1 Administration Guide.