Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8542

MTOM: Exceptions while reading the DataHandler's InputStream are not signaled to the client

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.4.3
    • Fix Version/s: None
    • Component/s: JAX-WS Runtime
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      If the DataHandler's InputStream throws an exception while transferring the data to the client, the client gets no clue that it has received incomplete data. Instead, the client believes that it has received the full data.
      I'd expect to get an exception while reading the InputStream from the DataHandler.

      Here's what happens on the server side:
      The IOException is caught in the AttachmentOutEndingInterceptor that transforms it into an Fault runtime exception:

      Interceptor for {http://example.com}MyWebService#{http://example.com/ws}GetBinaryData has thrown exception, unwinding now 
      org.apache.cxf.interceptor.Fault: Could not write attachments.
          at org.apache.cxf.interceptor.AttachmentOutInterceptor$AttachmentOutEndingInterceptor.handleMessage(AttachmentOutInterceptor.java:123)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
          at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:90)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
          at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
      ...
      

      This Fault is caught by the PhaseInterceptorChain which in turn returns false which is ignored by the ChainInitiationObserver. I.e. it seems to make no difference if the InputStream can be read correctly or if an exception is thrown while reading it.

      As I'm no CXF developer and cannot see the full picture I might be mistaken by my analysis. However, from the client's perspective the MTOM data seems to be correctly retrieved from the server which is not the case.

      Is there anything that can be done to make sure that the client receives an exception if the InputStream gets unexpectedly aborted on the server side?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              joijoe Joern Gebhardt
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: