Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-275

NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.0.2, 1.0.3
    • Fix Version/s: 1.5 M2, 1.0.4
    • Component/s: XML
    • Labels:
      None
    • Environment:
      Weblogic 8.1.5, JDK1.4.2_08, SAAJ 1.1

      Description

      This error is the result of improper handing of namespaces and their prefixes. Specifically, when using the default namespace attribute "xmlns". For example:

      <soap:Envelope>
      <soap:Body>
      <foo xmlns="bar" />
      </soap:Body>
      </soap:Envelope>

      The full stack trace is as follows:

      javax.xml.transform.TransformerException: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
      at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501)
      at org.springframework.ws.server.endpoint.support.PayloadRootUtils.getPayloadRootQName(PayloadRootUtils.java:87)
      at org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping.resolveQName(PayloadRootQNameEndpointMapping.java:57)
      at org.springframework.ws.server.endpoint.mapping.AbstractQNameEndpointMapping.getLookupKeyForMessage(AbstractQNameEndpointMapping.java:33)
      at org.springframework.ws.server.endpoint.mapping.AbstractMapBasedEndpointMapping.getEndpointInternal(AbstractMapBasedEndpointMapping.java:106)
      at org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping.getEndpoint(AbstractEndpointMapping.java:83)
      at org.springframework.ws.server.MessageDispatcher.getEndpoint(MessageDispatcher.java:242)
      at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:195)
      at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:162)
      at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:87)
      at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
      at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:197)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
      at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
      Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
      at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:374)
      at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(SaajXmlReader.java:140)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(SaajXmlReader.java:123)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlReader.java:115)
      at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlReader.java:96)
      at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
      ... 25 more

      Normally this error is associated with a buggy version of Xalan-J. In this case, however, it appears to be an error in org.springframework.ws.soap.saaj.support.SaajXmlReader.

      I have isolated the problem and will supply a patch.

        Attachments

          Activity

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              jpeterson Jeff Peterson
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: