Announcement Announcement Module
Collapse
No announcement yet.
Error in PayloadLoggingInterceptor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error in PayloadLoggingInterceptor

    Hello,
    I seem to have a strange issue with PayloadLoggingInterceptor on Spring-ws 1.5.2.

    Stacktrace:
    Code:
    03:06:32 DEBUG - support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'listMethodsEndpoint'
    ERROR:  'Namespace for prefix 'SOAP-ENC' has not been declared.'
    03:06:32 DEBUG - server.SoapMessageDispatcher - Endpoint invocation resulted in exception - responding with Fault
    javax.xml.transform.TransformerException: java.lang.RuntimeException: Namespace for prefix 'SOAP-ENC' has not been declared.
    	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:670)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
    	at org.springframework.ws.server.endpoint.AbstractLoggingInterceptor.logMessageSource(AbstractLoggingInterceptor.java:125)
    	at org.springframework.ws.server.endpoint.AbstractLoggingInterceptor.handleResponse(AbstractLoggingInterceptor.java:104)
    	at org.springframework.ws.server.MessageDispatcher.triggerHandleResponse(MessageDispatcher.java:347)
    	at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:224)
    	at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:168)
    	at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
    	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:523)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:463)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    	at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.RuntimeException: Namespace for prefix 'SOAP-ENC' has not been declared.
    	at com.sun.org.apache.xml.internal.serializer.SerializerBase.getNamespaceURI(SerializerBase.java:874)
    	at com.sun.org.apache.xml.internal.serializer.SerializerBase.addAttribute(SerializerBase.java:408)
    	at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.addAttribute(ToUnknownStream.java:286)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:186)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:215)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:81)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:615)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:661)
    	... 25 more
    ---------
    java.lang.RuntimeException: Namespace for prefix 'SOAP-ENC' has not been declared.
    	at com.sun.org.apache.xml.internal.serializer.SerializerBase.getNamespaceURI(SerializerBase.java:874)
    	at com.sun.org.apache.xml.internal.serializer.SerializerBase.addAttribute(SerializerBase.java:408)
    	at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.addAttribute(ToUnknownStream.java:286)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:186)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:215)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:81)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:615)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:661)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
    	at org.springframework.ws.server.endpoint.AbstractLoggingInterceptor.logMessageSource(AbstractLoggingInterceptor.java:125)
    	at org.springframework.ws.server.endpoint.AbstractLoggingInterceptor.handleResponse(AbstractLoggingInterceptor.java:104)
    	at org.springframework.ws.server.MessageDispatcher.triggerHandleResponse(MessageDispatcher.java:347)
    	at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:224)
    	at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:168)
    	at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
    	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:523)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:463)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    	at java.lang.Thread.run(Thread.java:595)
    The endpoint works perfectly fine with the interceptor disabled.
    The XML that is returned with it disabled is given here:
    Code:
    <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="hxxp://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="hxxp://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="hxxp://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="hxxp://zzz.w3.org/2001/XMLSchema" xmlns:xsi="hxxp://zzz.w3.org/2001/XMLSchema-instance" xmlns:xtee="hxxp://x-tee.riik.ee/xsd/xtee.xsd">
       <SOAP-ENV:Body>
          <xtee:ListMethodsResponse>
             <keha SOAP-ENC:arrayType="xsd:string[2]" SOAP-ENC:offset="[0]" xsi:type="SOAP-ENC:Array">
                <item xsi:type="xsd:string">test-tja-icsms.ProductSearch.v1</item>
                <item xsi:type="xsd:string">test-tja-icsms.ListMethods.v1</item>
             </keha>
          </xtee:ListMethodsResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    I had to censor the urls in the response (replace hxxp with http and zzz with www), due to the enforcement of having to have 15 posts before being able to post URLs.

    The request is logged fine, the error arises when logging the response (as seen from the stacktrace).

    Any ideas how this problem could be solved? Is my XML malformed somehow?
    I will continue without PayloadLoggingInterceptor for now, but it would be nice to get it working.

  • #2
    Never mind,
    I was able to solve this by using Xalan-2.7.1 instead of the built-in one.

    Comment

    Working...
    X