As far as I remember this is related to the saaj library used. I had a similar 
issue some years back within websphere. 

Deploy SAAJ within your application. Any sun saaj implementation depends on 
xerces shipped as part of the sun jdk (com.sun.org.apache.xerces...). I assume 
you run the app server with another JDK/JRE.

Try to add the following dependency:
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.saaj-impl</artifactId>
<version>1.3.9_2</version>
</dependency>

Thanks
Oli


------

Oliver Wulff

Blog: http://owulff.blogspot.com
Solution Architect
http://coders.talend.com

Talend Application Integration Division http://www.talend.com

________________________________________
From: liugang594 Liu [[email protected]]
Sent: 27 June 2013 05:41
To: [email protected]
Subject: Re: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was 
made to insert a node where it is not permitted

may be you gonna to proceed some xml document, which looks like:

<a>adfs</a>
<b>adfs</b>

That means you have multiple root nodes exist,  only one root node is
allowed like below:

<c>
<a>adfs</a>
<b>adfs</b>
</c>


2013/6/19 remo408 <[email protected]>

> Updating the CXF version to 2.7.4 partly fixed the issue. Then i need to
> Update my interceptor code as following to resolve this issue . The
> solution
> is well explained in this link:
>
> public class TestOutInterceptor extends AbstractSoapInterceptor {
>     private static Logger logger = LoggerFactory
>         .getLogger(EnterpriseServiceMonitoringOutInterceptor.class);
>     private SAAJOutInterceptor saajOut = new SAAJOutInterceptor();
>
>
>
>
>     public TestOutInterceptor() {
>     super(Phase.PRE_PROTOCOL);
>     getAfter().add(SAAJOutInterceptor.class.getName());
>     // TODO Auto-generated constructor stub
>     }
>
>     @Override
>     public void handleMessage(SoapMessage soapMessage) throws Fault {
>     getSOAPMessage(soapMessage);
>         //add the ending interceptor to do the work
>     soapMessage.getInterceptorChain().add(new EndingInterceptor());
>     }
>
>
>
>     private SOAPMessage getSOAPMessage(SoapMessage smsg){
>
>         SOAPMessage soapMessage = smsg.getContent(SOAPMessage.class);
>
>     if (soapMessage == null) {
>
>
>
>         saajOut.handleMessage(smsg);
>
>         soapMessage = smsg.getContent(SOAPMessage.class);
>
>     }
>
>     return soapMessage;
>
>   }
>
>     static class EndingInterceptor extends AbstractSoapInterceptor {
>
>     private SAAJOutEndingInterceptor saajOutEnding = new
> SAAJOutEndingInterceptor();
>         public EndingInterceptor() {
>              super(Phase.PRE_PROTOCOL_ENDING);
>              addBefore(SAAJOutEndingInterceptor.class.getName());
>          }
>         public void handleMessage(SoapMessage soapMessage) throws Fault {
>             ServiceData serviceData=(ServiceData)
> soapMessage.getExchange().remove("esmServiceData");
>         System.out.println("Test");
>         System.out.println(soapMessage.getInterceptorChain());
>
>         SOAPMessage soapMessagexml = getSOAPMessage(soapMessage);
>         if(serviceData!=null){
>             serviceData.setResponseTime(new BigDecimal((new
> Date()).getTime()));
>
>             ByteArrayOutputStream out = new ByteArrayOutputStream();
>             try {
>             soapMessagexml.writeTo(out);
>             String strMsg = new String(out.toByteArray());
>              serviceData.setResponsePayload(strMsg);
>              logger.debug(strMsg);
>             } catch (SOAPException e) {
>             logger.error("", e);
>             } catch (IOException e) {
>             logger.error("", e);
>             }
>
>         }
>         }
>
>         private SOAPMessage getSOAPMessage(SoapMessage smsg){
>
>             SOAPMessage soapMessage = smsg.getContent(SOAPMessage.class);
>
>         if (soapMessage == null) {
>
>
>
>             saajOutEnding .handleMessage(smsg);
>
>             soapMessage = smsg.getContent(SOAPMessage.class);
>
>         }
>
>         return soapMessage;
>
>       }
>    }
>
> }
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/org-w3c-dom-DOMException-HIERARCHY-REQUEST-ERR-An-attempt-was-made-to-insert-a-node-where-it-is-not-d-tp5729455p5729462.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



--
Thanks
GangLiu
MSN: [email protected]
Skype: gang.liu.talendbj

Reply via email to