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

Confusing error message "Problem writing SAAJ model to stream" in case if service not avalable (patch)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5
    • 2.5, 2.4.4, 2.3.8
    • Core
    • None
    • Windows

    • Unknown

    Description

      Hi,

      Issue was discussed in user list: http://www.mail-archive.com/users@cxf.apache.org/msg22444.html

      Use case: Dispatch client sends stream message to remote Web Service using following code:

      final Dispatch<StaxSource> dispatch = service.createDispatch(PORT_NAME,
      StaxSource.class, Service.Mode.MESSAGE);
      final StaxSource response = dispatch.invoke(request);

      In case if remote service is just not available, code throws following SoapFault:
      org.apache.cxf.binding.soap.SoapFault: Problem writing SAAJ model to stream
      at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.ha
      ndleMessage(SAAJOutInterceptor.java:214)[132:org.apache.cxf.bundle:2.4.2]
      at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.ha
      ndleMessage(SAAJOutInterceptor.java:170)[132:org.apache.cxf.bundle:2.4.2]
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.ja
      va:263)[132:org.apache.cxf.bundle:2.4.2]

      To be honest, the error message is quite confusing, I expect "Connection refused" exception here.

      The wrapped Exception is available:
      Caused by: com.ctc.wstx.exc.WstxIOException: Connection refused: connect
      at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:257)

      Patch is attached.

      Regards,
      Andrei.

      Attachments

        1. SAAJOutInterceptor-patch.java
          1 kB
          Andrei Shakirin

        Activity

          People

            Unassigned Unassigned
            ashakirin Andrei Shakirin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: