spring-ws icon indicating copy to clipboard operation
spring-ws copied to clipboard

Exceptions for control flow in Axiom support [SWS-959]

Open gregturn opened this issue 9 years ago • 1 comments
trafficstars

Philippe Marschall opened SWS-959 and commented

We use Spring WS with Axiom. During normal request processing of a non-XOP/MTOM request a org.apache.axiom.om.OMException will be thrown even if request processing is successful. We get the following stack trace:

org.apache.axiom.om.OMException.<init>(String)
org.apache.axiom.attachments.Attachments.getAttachmentSpecType()
org.springframework.ws.soap.axiom.AxiomSoapMessage.isXopPackage()
org.springframework.ws.soap.axiom.AxiomSoapMessage.getOutputFormat()
org.springframework.ws.soap.axiom.AxiomSoapMessage.writeTo(OutputStream)
org.springframework.ws.transport.AbstractWebServiceConnection.send(WebServiceMessage)
org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceConnection, WebServiceMessageReceiver)
org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(HttpServletRequest, HttpServletResponse, Object)
org.springframework.ws.transport.http.MessageDispatcherServlet.doService(HttpServletRequest, HttpServletResponse)
org.springframework.web.servlet.FrameworkServlet.processRequest(HttpServletRequest, HttpServletResponse)
org.springframework.web.servlet.FrameworkServlet.doPost(HttpServletRequest, HttpServletResponse)
javax.servlet.http.HttpServlet.service(HttpServletRequest, HttpServletResponse)
org.springframework.web.servlet.FrameworkServlet.service(HttpServletRequest, HttpServletResponse)
javax.servlet.http.HttpServlet.service(ServletRequest, ServletResponse)

inside org.apache.axiom.attachments.Attachments.getAttachmentSpecType() the delegate variable is an instance of org.apache.axiom.attachments.AttachmentSet

and #getContentType() is implemented as

ContentType getContentType() {
    return null;
}

Request processing is successful because the OMException is caught in org.springframework.ws.soap.axiom.AxiomSoapMessage.isXopPackage()

@Override
public boolean isXopPackage() {
     try {
          return MTOMConstants.MTOM_TYPE.equals(attachments.getAttachmentSpecType());
     }
     catch (OMException ex) {
          return false;
     }
     catch (NullPointerException ex) {
          // gotta love Axis2
          return false;
     }
}

Affects: 2.2.4

gregturn avatar May 30 '16 17:05 gregturn

I am not really following how the exception is logged with the information that you've shared. It seems to me, that the NPE check is meant to catch the implementation that you've shared. I agree this could be implemented differently but that doesn't explain why that code would throw an OMException

snicoll avatar Mar 26 '25 10:03 snicoll

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Apr 02 '25 10:04 spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-projects-issues avatar Apr 09 '25 10:04 spring-projects-issues