Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Spring WS org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope

Tags:

java

spring

I'am experencing a strange behaviour of a spring ws in different environments. Following works fine with Soap UI on a local tomcat 7.0.29, but does return below mentioned error.

servlet.xml:

<bean id="propertyPlaceholder"
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <value>classpath:ws.properties</value>
    </property>
    <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_FALLBACK" />
    <property name="searchSystemEnvironment" value="true" />
</bean>


<bean
    class="org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter">
    <property name="transformLocations" value="true" />
</bean>

<bean
    class="org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter">
    <property name="messageFactory">
        <bean class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" />
    </property>
</bean>

<bean id="payloadMapping"
    class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping">
    <property name="interceptors">
        <list>
            <ref local="validatingInterceptor" />
        </list>
    </property>
</bean>

<bean id="validatingInterceptor"
    class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor"
    autowire="byName">
    <property name="schema" value="/xsd/schema.xsd" />
    <property name="validateRequest" value="true" />
    <property name="validateResponse" value="true" />
</bean>



<bean
    class="org.springframework.ws.soap.server.endpoint.SoapFaultAnnotationExceptionResolver" />





<bean id="defaultHandlerMapping"
    class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />

<bean id="baseWsdlDefinition" abstract="true"
    class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
    <property name="requestSuffix" value="Request" />
    <property name="responseSuffix" value="Response" />
</bean>

<bean id="sampleJaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
    <property name="classesToBeBound">
        <list>
            <value>com.db.vhs.ws.jaxb.PlacementRequest</value>
            <value>com.db.vhs.ws.jaxb.PlacementResponse</value>...

scheam.xsd:

<xs:annotation>

    <xs:appinfo>

        <jaxb:globalBindings>

            <jaxb:javaType name="java.util.Date" xmlType="xs:dateTime"
                parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
                printMethod="javax.xml.bind.DatatypeConverter.printDateTime" />

        </jaxb:globalBindings>

    </xs:appinfo>

</xs:annotation>




<!-- getClusterRequest -->

<xs:element name="getClusterRequest">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="id" type="xs:long" />
        </xs:sequence>
    </xs:complexType>
</xs:element>

<xs:element name="getClusterResponse">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="id" type="xs:long" />
            <xs:element name="Vcenter" type="xs:string" />
            <xs:element name="NAME" type="xs:string" />
            <xs:element name="MOREF" type="xs:string" />
            <xs:element name="OVERALLSTATUS" type="xs:string" />
            <xs:element name="COLLECTIONDATE" type="xs:dateTime" />
            <xs:element name="DPMENABLED" type="xs:int" />
            <xs:element name="DRSENABLED" type="xs:int" />
            <xs:element name="HAENABLED" type="xs:int" />
            <xs:element name="NUMCPUCORES" type="xs:int" />
            <xs:element name="NUMHOSTS" type="xs:int" />
            <xs:element name="TOTALCPU" type="xs:long" />
            <xs:element name="TOTALMEMORY" type="xs:long" />
            <xs:element name="VDatacenterID" type="xs:long" />
        </xs:sequence>
    </xs:complexType>
</xs:element>


<xs:element name="placementRequest">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="request_header" type="header" />
            <xs:element name="request_body" type="requestBody" />
        </xs:sequence>
    </xs:complexType>
</xs:element>




<xs:complexType name="header">
    <xs:sequence>
        <xs:element name="request_id" type="xs:string" />
        <xs:element name="uuid" type="xs:string" />
        <xs:element name="type" type="xs:string" />
        <xs:element name="request_type">
            <xs:simpleType>
                <xs:restriction base="xs:int">
                    <xs:minInclusive value="0" />
                    <xs:maxInclusive value="1" />
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
    </xs:sequence>
</xs:complexType>



<xs:complexType name="requestBody">
    <xs:sequence>
        <xs:choice>
            <xs:element name="cluster_request" type="clusterRequest" />
            <xs:element name="region_request" type="regionRequest" />
        </xs:choice>
    </xs:sequence>
</xs:complexType>



<xs:complexType name="clusterRequest">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
        <xs:element name="cluster" type="xs:string" />
    </xs:sequence>
</xs:complexType>

<xs:complexType name="regionRequest">
    <xs:sequence>
        <xs:element name="region" type="xs:string" />
        <xs:element name="OS" type="xs:string" />
        <xs:element name="clusterProductType">
            <xs:simpleType>
                <xs:list itemType="xs:string" />
            </xs:simpleType>
        </xs:element>
        <xs:element name="class">
            <xs:simpleType>
                <xs:restriction base="xs:int">
                    <xs:minInclusive value="0" />
                    <xs:maxInclusive value="3" />
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="class_type">
            <xs:simpleType>
                <xs:restriction base="xs:int">
                    <xs:minInclusive value="0" />
                    <xs:maxInclusive value="2" />
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="subnet" type="xs:string" />
    </xs:sequence>
</xs:complexType>





<xs:element name="placementResponse">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="response_header" type="header" />
            <xs:element name="response_body" type="responseBody" />
        </xs:sequence>
    </xs:complexType>
</xs:element>





<xs:complexType name="responseBody">
    <xs:sequence>
        <xs:element name="class">
            <xs:simpleType>
                <xs:restriction base="xs:int">
                    <xs:minInclusive value="0" />
                    <xs:maxInclusive value="3" />
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="capacity">
            <xs:complexType>
                <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:element name="cluster">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="cluster_name" type="xs:string"></xs:element>
                                <xs:element name="v_center" type="xs:string"></xs:element>
                                <xs:sequence minOccurs="0" maxOccurs="unbounded">
                                    <xs:element name="storage" type="storage"></xs:element>
                                </xs:sequence>
                                <xs:sequence minOccurs="0" maxOccurs="unbounded">
                                    <xs:element name="host" type="host"></xs:element>
                                </xs:sequence>
                                <xs:element name="class_type" type="xs:int"></xs:element>
                                <xs:element name="timestamp" type="xs:string"></xs:element>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
    </xs:sequence>
</xs:complexType>




<!-- complex types for response ngp -->


<xs:complexType name="storage">
    <xs:sequence>
        <xs:element name="data_store_name" type="xs:string" />
        <xs:element name="total_storage" type="xs:long" />
        <xs:element name="allocated_storage" type="xs:long" />
        <xs:element name="storage_class" type="xs:string" />
    </xs:sequence>
</xs:complexType>


<xs:complexType name="host">
    <xs:sequence>
        <xs:element name="host_name" type="xs:string" />
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element name="port_group_name" type="portgroup" />
        </xs:sequence>
        <xs:element name="physical_cpus" type="xs:int" />
        <xs:element name="allocated_cpus" type="xs:int" />
        <xs:element name="available_cpu_size" type="xs:long" />
        <xs:element name="average_cpu_usage" type="xs:double" />
        <xs:element name="max_cpu_usage" type="xs:double" />
        <xs:element name="physical_memory" type="xs:long" />
        <xs:element name="allocated_memory" type="xs:long" />
        <xs:element name="average_memory_usage" type="xs:double" />
        <xs:element name="max_memory_usage" type="xs:double" />
        <xs:element name="number_of_vms" type="xs:int" />
    </xs:sequence>
</xs:complexType>

<xs:complexType name="portgroup">
    <xs:sequence>
        <xs:element name="name" type="xs:string" />
        <xs:element name="subnet" type="xs:string" />
    </xs:sequence>
</xs:complexType>

The first method works in both environments, the second (placementRequest) returns:

<html><head><title>Apache Tomcat/7.0.29 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - Request processing 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: </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u>Request processing 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: </u></p><p><b>description</b> <u>The server encountered an internal error (Request processing 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.</u></p><p><b>exception</b> <pre>org.springframework.web.util.NestedServletException: Request processing 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)

root cause

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)

root cause

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)

root cause

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)

root cause

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)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.29 logs.

Apache Tomcat/7.0.29

pom.xml:

<dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>4.1.2</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-jdbc</artifactId>
        <version>7.0.29</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-ws-core-tiger</artifactId>
        <version>1.5.7</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-ws-core</artifactId>
        <version>1.5.7</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.messaging.saaj</groupId>
        <artifactId>saaj-impl</artifactId>
        <version>1.3</version>
    </dependency>
    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.8.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.ws.commons.schema</groupId>
        <artifactId>XmlSchema</artifactId>
        <version>1.4.2</version>
    </dependency>
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.2</version>
    </dependency>
    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>11.2.0.2.0</version>
    </dependency>
    <dependency>
        <groupId>com.cloudbees.thirdparty</groupId>
        <artifactId>vijava</artifactId>
        <version>5.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.4</version>
    </dependency>
    <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.6</version>
    </dependency>
    <dependency>
        <groupId>commons-configuration</groupId>
        <artifactId>commons-configuration</artifactId>
        <version>1.7</version>
    </dependency>
    <dependency>
        <groupId>dom4j</groupId>
        <artifactId>dom4j</artifactId>
        <version>1.6.1</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>4.1.2</version>
    </dependency>
</dependencies>

I read that it could be that the web server overrides the maven dependencies? Or do you have any suggestions how to solve this? Greatly appreciated if someone can help!!!

like image 849
Zander Avatar asked Sep 17 '12 21:09

Zander


2 Answers

I had the same error as you. I've found the solution here: http://mmmsoftware.blogspot.com.es/2009/06/xml-namespace-error-with-spring-ws.html

Basically you have to use upper versions of xalan and xercesimpl. My pom's dependencies look like this:

<project ...>
 ...
<dependencies>

             ...

    <dependency>
        <groupId>jaxen</groupId>
        <artifactId>jaxen</artifactId>
        <version>1.1.3</version>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <artifactId>maven-cobertura-plugin</artifactId>
                <groupId>maven-plugins</groupId>
            </exclusion>
            <exclusion>
                <artifactId>maven-findbugs-plugin</artifactId>
                <groupId>maven-plugins</groupId>
            </exclusion>
            <exclusion>
                <artifactId>xalan</artifactId>
                <groupId>xalan</groupId>
            </exclusion>
            <exclusion>
                <artifactId>xercesImpl</artifactId>
                <groupId>xerces</groupId>
            </exclusion>
        </exclusions>
    </dependency>

             ...

    <dependency>
        <groupId>xalan</groupId>
        <artifactId>xalan</artifactId>
        <version>2.7.0</version>
        <type>jar</type>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <artifactId>xml-apis</artifactId>
                <groupId>xml-apis</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.9.1</version>
        <type>jar</type>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <artifactId>xml-apis</artifactId>
                <groupId>xml-apis</groupId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>
 ...
</project>

I hope it helps you.

like image 99
Carlos Avatar answered Sep 28 '22 03:09

Carlos


I've just managed the same problem.

In my situation the problem was in old spring-ws version being used with HTTPS.

Upgrading to the latest (2.1.3) helped.

like image 32
Val Avatar answered Sep 28 '22 03:09

Val