Java Spring WebServiceTemplate HIERARCHY_REQUEST_ERR

时间:2011-04-06 03:24:10

标签: java web-services spring

我正在尝试使用Spring WebServiceTemplate来调用Web服务。我创建了一个独立的项目并经过测试,它可以工作。

现在,我将这个项目添加到另一个项目进行测试,当我添加spring-oxm.tiger-1.5.6.jar

时收到此错误

我应该注意这个罐子的冲突吗?

干杯全部!

以下是错误的堆栈跟踪:

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)

1 个答案:

答案 0 :(得分:0)

SaajSoapMessageFactory的当前实现中可能是defect所以我要将用于创建消息的工厂更改为AxiomSoapMessageFactory或尝试使用更新版本的Spring-WS来查看如果问题仍然存在。

要更改消息工厂实现,请参阅Spring documentation