Note that there are some explanatory texts on larger screens.

plurals
  1. POWRONG_DOCUMENT_ERR when invoking CXF client with WSS interceptor from JBoss 5.1.0GA
    primarykey
    data
    text
    <p>I have CXF web service client with WSS interceptor that works from console, but when run from JBoss throws exception like that:</p> <p>Unexpected exception occured </p> <pre><code>Unexpected exception occured javax.xml.ws.soap.SOAPFaultException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it. at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156) at $Proxy1020.getAccountStatements(Unknown Source) at com.sru.statement.impl.cs.CSStatementGetter.getStatementFromBank(CSStatementGetter.java:164) at com.sru.statement.impl.cs.CSStatementGetter.getStatement(CSStatementGetter.java:90) at com.sru.hub.common.statement.CommonStatementImportExecutor.execute(CommonStatementImportExecutor.java:89) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) (...) at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: 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:119) at org.apache.cxf.staxutils.W3CDOMStreamWriter.newChild(W3CDOMStreamWriter.java:109) at org.apache.cxf.staxutils.W3CDOMStreamWriter.writeStartElement(W3CDOMStreamWriter.java:137) 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:531) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:462) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:365) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:318) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:95) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) ... 80 more </code></pre> <p>It works with those libraries:</p> <pre><code>/org/apache/cxf/cxf-rt-frontend-jaxws/2.4.2/cxf-rt-frontend-jaxws-2.4.2.jar /org/apache/cxf/cxf-api/2.4.2/cxf-api-2.4.2.jar /org/apache/cxf/cxf-common-utilities/2.4.2/cxf-common-utilities-2.4.2.jar /org/apache/cxf/cxf-rt-core/2.4.2/cxf-rt-core-2.4.2.jar /org/apache/cxf/cxf-rt-frontend-simple/2.4.2/cxf-rt-frontend-simple-2.4.2.jar /wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar /org/apache/ws/xmlschema/xmlschema-core/2.0/xmlschema-core-2.0.jar /org/apache/cxf/cxf-rt-bindings-soap/2.4.2/cxf-rt-bindings-soap-2.4.2.jar /org/apache/cxf/cxf-tools-common/2.4.2/cxf-tools-common-2.4.2.jar /org/apache/cxf/cxf-rt-databinding-jaxb/2.4.2/cxf-rt-databinding-jaxb-2.4.2.jar /org/apache/cxf/cxf-rt-ws-addr/2.4.2/cxf-rt-ws-addr-2.4.2.jar /org/apache/neethi/neethi/3.0.1/neethi-3.0.1.jar /org/apache/cxf/cxf-rt-ws-security/2.4.2/cxf-rt-ws-security-2.4.2.jar /org/apache/ws/security/wss4j/1.6.2/wss4j-1.6.2.jar /commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar /org/apache/cxf/cxf-rt-transports-http/2.4.2/cxf-rt-transports-http-2.4.2.jar /org/apache/xmlsec/1.4.2/xmlsec-1.4.2.jar /commons-io/commons-io/2.4/commons-io-2.4.jar </code></pre> <p>If client is invoked without WSS interceptor, everything works ok.</p> <p>WSS interceptor code:</p> <pre><code>Client client = ClientProxy.getClient(port); Endpoint cxfEndpoint = client.getEndpoint(); Map&lt;String, Object&gt; outProps = new HashMap&lt;String, Object&gt;(); outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN); outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT); outProps.put(WSHandlerConstants.USER, "username_alex"); outProps.put(WSHandlerConstants.ADD_UT_ELEMENTS, WSConstants.NONCE_LN + " " +WSConstants.CREATED_LN); outProps.put(WSHandlerConstants.PW_CALLBACK_REF, this); WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); cxfEndpoint.getOutInterceptors().add(wssOut); </code></pre> <p>Any ideas what happen here?</p> <p>Update:</p> <p>Some additional hints. I hope it would be helpful:</p> <ol> <li>I tried to run the application on Tomcat. It works,</li> <li>Because of this ticket: <a href="https://issues.apache.org/jira/browse/CXF-4612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel" rel="nofollow">https://issues.apache.org/jira/browse/CXF-4612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel</a> I tested the application with two additional versions of CXF: 2.5.7 and 2.5.8. It failed.</li> <li>In /lib/endorsed of my JBoss I have two implementations of SAAJ: axis-saaj.jar and jboss-native-saaj.jar. I tried to combine those libraries and spotted that without both of them the application hand out when processing web service with WSS (application works but nothing happened: there's not error both in the browser and logs),</li> <li>I tried also to add axis-saaj and jboss-native-saaj (separately) to the application's WAR file. The result is similar to point 3.: application hands.</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload