我在不同的环境中解开了春天的奇怪行为.以下在本地tomcat 7.0.29上使用Soap UI工作正常,但确实返回下面提到的错误.
servlet.xml中:
scheam.xsd:
cpuCORES" type="xs:int" />
cpu" type="xs:long" />
cpus" type="xs:int" />
cpus" type="xs:int" />
cpu_size" type="xs:long" />
cpu_usage" type="xs:double" />
cpu_usage" type="xs:double" />
第一种方法适用于两种环境,第二种方法(placementRequest)返回:
Failed; nested exception is org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: Failed; nested exception is org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: Failed; nested exception is org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: ) that prevented it from fulfilling this request.Failed; nested exception is org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:583)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
根本原因
org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: org.springframework.ws.soap.saaj.SaajSoapMessage.getEnvelope(SaajSoapMessage.java:107) org.springframework.ws.soap.AbstractSoapMessage.getSoapBody(AbstractSoapMessage.java:36) org.springframework.ws.soap.AbstractSoapMessage.getPayloadSource(AbstractSoapMessage.java:46) org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping.getLookupKeyForMessage(PayloadRootAnnotationMethodEndpointMapping.java:57) org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping.getEndpointInternal(AbstractMethodEndpointMapping.java:56) org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping.getEndpoint(AbstractEndpointMapping.java:83) org.springframework.ws.server.MessageDispatcher.getEndpoint(MessageDispatcher.java:248) org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:201) org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:168) org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88) org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511) javax.servlet.http.HttpServlet.service(HttpServlet.java:641) javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
根本原因
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:114) com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:70) com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122) org.springframework.ws.soap.saaj.Saaj13Implementation.getEnvelope(Saaj13Implementation.java:169) org.springframework.ws.soap.saaj.SaajSoapMessage.getEnvelope(SaajSoapMessage.java:103) org.springframework.ws.soap.AbstractSoapMessage.getSoapBody(AbstractSoapMessage.java:36) org.springframework.ws.soap.AbstractSoapMessage.getPayloadSource(AbstractSoapMessage.java:46) org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping.getLookupKeyForMessage(PayloadRootAnnotationMethodEndpointMapping.java:57) org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping.getEndpointInternal(AbstractMethodEndpointMapping.java:56) org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping.getEndpoint(AbstractEndpointMapping.java:83) org.springframework.ws.server.MessageDispatcher.getEndpoint(MessageDispatcher.java:248) org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:201) org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:168) org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88) org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511) javax.servlet.http.HttpServlet.service(HttpServlet.java:641) javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
根本原因
javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed. com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:719) com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313) com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:393) com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102) com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:70) com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122) org.springframework.ws.soap.saaj.Saaj13Implementation.getEnvelope(Saaj13Implementation.java:169) org.springframework.ws.soap.saaj.SaajSoapMessage.getEnvelope(SaajSoapMessage.java:103) org.springframework.ws.soap.AbstractSoapMessage.getSoapBody(AbstractSoapMessage.java:36) org.springframework.ws.soap.AbstractSoapMessage.getPayloadSource(AbstractSoapMessage.java:46) org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping.getLookupKeyForMessage(PayloadRootAnnotationMethodEndpointMapping.java:57) org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping.getEndpointInternal(AbstractMethodEndpointMapping.java:56) org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping.getEndpoint(AbstractEndpointMapping.java:83) org.springframework.ws.server.MessageDispatcher.getEndpoint(MessageDispatcher.java:248) org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:201) org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:168) org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88) org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511) javax.servlet.http.HttpServlet.service(HttpServlet.java:641) javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
根本原因
org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed. com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231) com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333) com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:636) com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:707) com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313) com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:393) com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102) com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:70) com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122) org.springframework.ws.soap.saaj.Saaj13Implementation.getEnvelope(Saaj13Implementation.java:169) org.springframework.ws.soap.saaj.SaajSoapMessage.getEnvelope(SaajSoapMessage.java:103) org.springframework.ws.soap.AbstractSoapMessage.getSoapBody(AbstractSoapMessage.java:36) org.springframework.ws.soap.AbstractSoapMessage.getPayloadSource(AbstractSoapMessage.java:46) org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping.getLookupKeyForMessage(PayloadRootAnnotationMethodEndpointMapping.java:57) org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping.getEndpointInternal(AbstractMethodEndpointMapping.java:56) org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping.getEndpoint(AbstractEndpointMapping.java:83) org.springframework.ws.server.MessageDispatcher.getEndpoint(MessageDispatcher.java:248) org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:201) org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:168) org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88) org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511) javax.servlet.http.HttpServlet.service(HttpServlet.java:641) javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
注意Apache Tomcat / 7.0.29 logs.Apache Tomcat / 7.0.29中提供了根本原因的完整堆栈跟踪
pom.xml中:
我读到可能是Web服务器覆盖了maven依赖项?或者您有任何建议如何解决这个问题?非常感谢,如果有人可以帮助!
最佳答案
我和你有同样的错误.我在这里找到了解决方案:http://mmmsoftware.blogspot.com.es/2009/06/xml-namespace-error-with-spring-ws.html
原文链接:https://www.f2er.com/spring/432739.html基本上你必须使用xalan和xercesimpl的上层版本.我的pom的依赖关系看起来像这样:
我希望它对你有所帮助.