Weird problems when packaging my own web service implementation in my deployment (e.g. SpringWS and CXF)

Solution Verified - Updated -

Issue

  • I'm getting the following error when trying to use Metro (JAX-WS RI) in my deployment:
java.lang.Error: javax.xml.soap.SOAPException: Unable to create SAAJ meta-factoryProvider org.jboss.ws.core.soap.SAAJMetaFactoryImpl not found
  • My SOAP Responses are missing data when using Spring WS. For example, this response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <ns2:HelloResponse xmlns:ns2="http://example.jboss.com/">
         <ns2:message>Hello, World!</ns2:message>
      </ns2:HelloResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Is actually sent like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <ns2:HelloResponse xmlns:ns2="http://example.jboss.com/"/>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
  • I am packaging CXF in my application, and I'm getting this error when invoking a JAX-WS client proxy:
org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
    at org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown Source)
    at org.apache.xerces.dom.ParentNode.insertBefore(Unknown Source)
    at org.apache.xerces.dom.CoreDocumentImpl.insertBefore(Unknown Source)
    at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
    at org.jboss.ws.core.soap.SOAPDocument.appendChild(SOAPDocument.java:222)
    at org.jboss.ws.core.soap.SOAPPartImpl.appendChild(SOAPPartImpl.java:297)
    at org.apache.cxf.staxutils.W3CDOMStreamWriter.setChild(W3CDOMStreamWriter.java:114)
    at org.apache.cxf.staxutils.W3CDOMStreamWriter.newChild(W3CDOMStreamWriter.java:104)
    at org.apache.cxf.staxutils.W3CDOMStreamWriter.writeStartElement(W3CDOMStreamWriter.java:132)
    at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart(SoapOutInterceptor.java:122)
    at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:81)
    at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:61)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:533)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x
  • Spring WS
  • Apache CXF (not shipped by Red Hat)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content