开发者

Java Spring WebServiceTemplate HIERARCHY_REQUEST_ERR

开发者 https://www.devze.com 2023-02-22 03:26 出处:网络
I am trying to use the Spring WebServiceTemplate to call a web service.I created a stand alone project and tested, it works.

I am trying to use the Spring WebServiceTemplate to call a web service. I created a stand alone project and tested, it works.

Now, I add this same project with another project to test, and I receive this error when I add the spring-oxm.tiger-开发者_Go百科1.5.6.jar

Is there any conflicts for this jar that I should be aware of?

Cheers All!

Here is the stacktrace of the error:

org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. 
    at org.apache.axiom.om.impl.dom.NodeImpl.insertBefore(NodeImpl.java:261)
    at org.apache.axiom.om.impl.dom.NodeImpl.appendChild(NodeImpl.java:240)
    at com.sun.xml.bind.marshaller.SAX2DOMEx.startElement(SAX2DOMEx.java:176)
    at com.sun.xml.bind.v2.runtime.output.SAXOutput.endStartTag(SAXOutput.java:124)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.endAttributes(XMLSerializer.java:302)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:588)
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:312)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:490)
    at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:325)
    at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:254)
    at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:379)
    at org.springframework.ws.support.MarshallingUtils.marshal(MarshallingUtils.java:81)
    at org.springframework.ws.client.core.WebServiceTemplate$2.doWithMessage(WebServiceTemplate.java:360)
    at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:535)
    at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:351)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:345)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:337)


It might be defect in the current implementation of SaajSoapMessageFactory so I would either change the factory to be used for messages creation to AxiomSoapMessageFactory or tried newer version of Spring-WS to see if problem still exists.

To change message factory implementation see Spring documentation.

0

精彩评论

暂无评论...
验证码 换一张
取 消