From beef3660b53065c96fcee101bdbb50fc830a81dc Mon Sep 17 00:00:00 2001
From: Arjen Poutsma
The only solution that works is to add newer versions of Xerces and Xalan in the lib/endorsed - directory of your JDK, as explained in those FAQs. + directory of your JDK, as explained in those FAQs (i.e.$JAVA_HOME/lib/endorsed). + The following libraries are known to work with Java 1.4.2:
+| Library | +Version | +
|---|---|
| + Xerces + | +2.8.1 | +
| + Xalan + | +2.7.0 | +
| + XML-APIs + | +1.3.04 | +
- Note that the security module requires Java 5, because an underlying library (XWSS) requires it. + Note that the security module requires Java 5, because an underlying library (XWSS) requires it. + Also note that SAAJ 1.3 required Java 5 as well, so you need to use SAAJ 1.2 (which can be + downloaded as part of the + Java Web Services Developer Pack 1.3.
@@ -30,7 +63,7 @@Spring Web Services works under Java 1.6, but you must make sure to use the versions of Xerces and Xalan that are packaged with it. Using other XML parsing libraries will cause exceptions to occur - in the org.apache.xml.serializer.ToXMLSAXHandler. + in theorg.apache.xml.serializer.ToXMLSAXHandler.
Therefore, when using Java 6, do not bundle Xerces, nor Xalan in your application. @@ -47,7 +80,10 @@
The jar can be found at - /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/.compatibility/14compatibility.jar. + + /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/.compatibility/14compatibility.jar + + . You can safely remove or rename it, and the tests will run again.
@@ -59,14 +95,17 @@- SAAJ is the SOAP with Attachments API for Java. Previously, it has been part of JAXM, but it has + SAAJ is the SOAP with Attachments API for Java. Like most Java EE libraries, it consists of a set of + interfaces (saaj-api.jar), and implementations (saaj-impl.jar). When running in + a Application Server, the implementation is typically provided by the application server. + Previously, SAAJ has been part of JAXM, but it has been released as a seperate API as part of the Java Web Service Developer Pack, and - also as part of J2EE 1.4. SAAJ is generally known as the package javax.xml.soap. + also as part of J2EE 1.4. SAAJ is generally known as the packagejavax.xml.soap.
Spring-WS uses this standard SAAJ library to create representations of SOAP messages. Alternatively, - it can use Apache AXIOM. + it can useApache AXIOM.
* = See below.
-** = See below.
+* = Seebelow. +
+** = Seebelow. +
Additionally, Java SE 6 includes SAAJ 1.3.
If you get the following stack trace:
-org.springframework.beans.factory.BeanCreationException:
-Error creating bean with name 'org.springframework.ws.soap.saaj.SaajSoapMessageFactory'
-defined in ServletContext resource [/WEB-INF/springws-servlet.xml]:
-Invocation of init method failed;
-nested exception is java.lang.NoSuchMethodError:
-javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactory;
-Caused by:
-java.lang.NoSuchMethodError:
-javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactory;
+ org.springframework.beans.factory.BeanCreationException:
+ Error creating bean with name 'org.springframework.ws.soap.saaj.SaajSoapMessageFactory'
+ defined in ServletContext resource [/WEB-INF/springws-servlet.xml]:
+ Invocation of init method failed;
+ nested exception is java.lang.NoSuchMethodError:
+ javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactory;
+ Caused by:
+ java.lang.NoSuchMethodError:
+ javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactory;
Like most J2EE libraries, SAAJ consists of two parts: the API that consists of interfaces @@ -138,16 +185,20 @@ javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/Mes
Weblogic 9 has a known bug in the SAAJ 1.2 implementation: it implement all the 1.2 interfaces, - but throws UnsupportedOperationExceptions when you call them. - Confusingly, the exception message is This class does not support SAAJ 1.1, even though - it supports SAAJ 1.1 just fine; it just doesn't support SAAJ 1.2. - See also this BEA forum post. + but throws + UnsupportedOperationExceptions + when you call them. + Confusingly, the exception message isThis class does not support SAAJ 1.1, even though + it supports SAAJ 1.1 just fine; it just doesn't support SAAJ1.2. + See alsothis BEA forum post.
Spring-WS has a workaround for this, we basically use SAAJ 1.1 only when dealing with Weblogic 9. @@ -157,28 +208,34 @@ javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/Mes
The solution is to not use BEA's version of SAAJ, but to use another implementation, like the one
from Axis 1, or SUN. In you application context, use the following:
-
The SAAJ implementation provided by JBoss has some issues. The solution is therefore not to use
the JBoss implementation, but to use another implementation. For instance, you can use SUN's
reference implementation like so:
-