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

CXF goes in Infinite loop when service endpoint throws SOAPFaultException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.8, 3.3.1
    • Fix Version/s: 3.2.9, 3.3.2, 3.4.0
    • Component/s: Core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      CXF will stuck in a infinite loop when add a detail element in SoapFault of SOAPFaultException:

      @WebService(name = "MyEchoService", targetNamespace = "urn:echo")
      @Logging
      public class MyEchoService {
      @WebMethod
      public String echoException(String input) throws SOAPFaultException {
      SOAPFaultException ex;
      try

      { ex = wrapToSoapFault(new Exception("hello")); }

      catch (Exception e)

      { // TODO Auto-generated catch block return e.toString(); }

      throw ex;
      }
      private SOAPFaultException wrapToSoapFault(Exception ex) throws Exception {
      SOAPFactory fac = null;
      try

      { fac = SOAPFactory.newInstance(); String message = ex.getMessage(); SOAPFault sf = fac.createFault(message, new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Client")); sf.setFaultString("ERROR"); //Add detail gets cxf goes into infinite loop sf.addDetail().setAttribute("message", message); return new SOAPFaultException(sf); }

      catch (Exception e2)

      { throw e2; }

      }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ema Jim Ma
                Reporter:
                ema Jim Ma
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m