Skip to content

Commit 8797abd

Browse files
committed
Added JBoss SAAJ FAQ.
1 parent 36009f8 commit 8797abd

File tree

1 file changed

+45
-59
lines changed

1 file changed

+45
-59
lines changed

src/site/fml/faq.fml

Lines changed: 45 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
bundled with the older XML parser Crimson, which does not handle namespaces correctly. Additionally,
1212
it is bundled with an older version of Xalan, which also has problems.
1313
Unfortunately, placing newer versions of these on the class path does not override them.
14-
See
15-
<a href="http://xml.apache.org/xalan-j/faq.html#faq-N100D6">this FAQ</a>
16-
entry on the Xalan site, and also
17-
<a href="http://xerces.apache.org/xerces2-j/faq-general.html#faq-4">this entry</a>
14+
See <a href="http://xml.apache.org/xalan-j/faq.html#faq-N100D6">this FAQ</a> entry on the Xalan
15+
site, and also <a href="http://xerces.apache.org/xerces2-j/faq-general.html#faq-4">this entry</a>
1816
on the Xerces site.
1917
</p>
2018
<p>
@@ -33,10 +31,8 @@
3331
</p>
3432
<p>
3533
The jar can be found at
36-
<tt>
37-
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/.compatibility/14compatibility.jar
38-
</tt>
39-
. You can safely remove or rename it, and the tests will run again.
34+
<tt>/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/.compatibility/14compatibility.jar</tt>.
35+
You can safely remove or rename it, and the tests will run again.
4036
</p>
4137
</answer>
4238
</faq>
@@ -48,20 +44,13 @@
4844
<answer>
4945
<p>
5046
SAAJ is the SOAP with Attachments API for Java. Previously, it has been part of JAXM, but it has
51-
been
52-
released as a seperate API as part of the
53-
<a href="http://java.sun.com/webservices/jwsdp/index.jsp">Java Web Service
54-
Developer Pack
55-
</a>
56-
, and also as part of J2EE 1.4. SAAJ is generally known as the package
57-
<tt>javax.xml.soap</tt>
58-
.
47+
been released as a seperate API as part of the
48+
<a href="http://java.sun.com/webservices/jwsdp/index.jsp">Java Web Service Developer Pack</a>, and
49+
also as part of J2EE 1.4. SAAJ is generally known as the package <tt>javax.xml.soap</tt>.
5950
</p>
6051
<p>
6152
Spring-WS uses this standard SAAJ library to create representations of SOAP messages. Alternatively,
62-
it can use
63-
<a href="http://ws.apache.org/commons/axiom/index.html">Apache AXIOM</a>
64-
.
53+
it can use <a href="http://ws.apache.org/commons/axiom/index.html">Apache AXIOM</a>.
6554
</p>
6655
</answer>
6756
</faq>
@@ -90,9 +79,14 @@
9079
<td>SUN Glassfish 1</td>
9180
<td>1.3</td>
9281
</tr>
82+
<tr>
83+
<td>JBoss 4.2</td>
84+
<td>1.3 <sup>**</sup></td>
85+
</tr>
9386
</tbody>
9487
</table>
9588
<p>* = See <a href="#saaj-weblogic9">below</a>.</p>
89+
<p>** = See <a href="#saaj-jboss">below</a>.</p>
9690
<p>Additionally, Java SE 6 includes SAAJ 1.3.</p>
9791
</answer>
9892
</faq>
@@ -113,11 +107,8 @@ java.lang.NoSuchMethodError:
113107
javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactory;
114108
</pre>
115109
<p>
116-
Like most J2EE libraries, SAAJ consists of two parts: the API that consists of interfaces (
117-
<tt>saaj-api.jar</tt>
118-
) and the implementation (
119-
<tt>saaj-impl.jar</tt>
120-
).
110+
Like most J2EE libraries, SAAJ consists of two parts: the API that consists of interfaces
111+
(<tt>saaj-api.jar</tt>) and the implementation (<tt>saaj-impl.jar</tt>).
121112
The stack trace is due to the fact that you are using a new version of the API (SAAJ 1.3), while
122113
your application server provides an earlier version of the implementation (SAAJ 1.2 or even 1.1).
123114
Spring-WS supports all three versions of SAAJ (1.1 through 1.3), but things break when it sees
@@ -150,12 +141,28 @@ javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/Mes
150141
<p>
151142
The solution is to not use BEA's version of SAAJ, but to use another implementation, like the one
152143
from Axis 1, or SUN. In you application context, use the following:
153-
<pre>
154-
&lt;bean id=&quot;messageFactory&quot; class=&quot;org.springframework.ws.soap.saaj.SaajSoapMessageFactory&quot;&gt;
155-
&lt;property name=&quot;messageFactory&quot;&gt;
156-
&lt;bean class=&quot;com.sun.xml.messaging.saaj.soap.MessageFactoryImpl&quot;/&gt;
157-
&lt;/bean&gt;
158-
</pre>
144+
<source><bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
145+
<property name="messageFactory">
146+
<bean class="com.sun.xml.messaging.saaj.soap.MessageFactoryImpl"/>
147+
</property>
148+
</bean></source>
149+
</p>
150+
</answer>
151+
</faq>
152+
<faq id="saaj-jboss">
153+
<question>
154+
I get a <tt>IndexOutOfBoundsException</tt> when I use SAAJ under JBoss. What can I do about it?
155+
</question>
156+
<answer>
157+
<p>
158+
The SAAJ implementation provided by JBoss has some issues. The solution is therefore not to use
159+
the JBoss implementation, but to use another implementation. For instance, you can use SUN's
160+
reference implementation like so:
161+
<source><bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
162+
<property name="messageFactory">
163+
<bean class="com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"/>
164+
</property>
165+
</bean></source>
159166
</p>
160167
</answer>
161168
</faq>
@@ -187,37 +194,16 @@ javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/Mes
187194
<ul>
188195
<li>
189196
Simply add the WSDL to the root of the WAR, and the file is served normally. This has the
190-
disadvantage
191-
that the "location" attribute in the WSDL is static, i.e. it does not necessarily reflect
192-
the
193-
host name
194-
of
195-
the
196-
server. That is why in the airline sample
197-
<tt>airline-servlet.xml</tt>
198-
, we define an
197+
disadvantage that the "location" attribute in the WSDL is static, i.e. it does not
198+
necessarily reflect the host name of the server. You can transform locations by using a
199+
<a href="http://static.springframework.org/spring-ws/site/apidocs/org/springframework/ws/transport/http/WsdlDefinitionHandlerAdapter.html">
199200
<tt>WsdlDefinitionHandlerAdapter</tt>
200-
there, which
201-
transforms the
202-
location.
201+
</a>.
203202
</li>
204-
<li>Use the
205-
<tt>MessageDispatcherServlet</tt>
206-
, which is done is the echo sample. Every
207-
<tt>WsdlDefinition</tt>
208-
listed in the
209-
<tt>*-servlet.xml</tt>
210-
will be exposed under the bean name. So if you define a
211-
<tt>WsdlDefinition</tt>
212-
named
213-
<tt>echo</tt>
214-
, it will be
215-
exposed as
216-
<tt>echo.wsdl</tt>
217-
. (i.e.
218-
<tt>http://localhost:8080/echo/echo.wsdl
219-
</tt>
220-
).
203+
<li>Use the <tt>MessageDispatcherServlet</tt>, which is done is the samples. Every
204+
<tt>WsdlDefinition</tt> listed in the <tt>*-servlet.xml</tt> will be exposed under the
205+
bean name. So if you define a <tt>WsdlDefinition</tt> named <tt>echo</tt>, it will be
206+
exposed as <tt>echo.wsdl</tt>. (i.e. <tt>http://localhost:8080/echo/echo.wsdl</tt>).
221207
</li>
222208
</ul>
223209
</p>

0 commit comments

Comments
 (0)