Uploaded image for project: 'ServiceMix Components'
  1. ServiceMix Components
  2. SMXCOMP-218

servicemix-validation throws JBIException instead of FaultException

    XMLWordPrintableJSON

Details

    Description

      The old lightweight validation component used to throw a org.apache.servicemix.jbi.FaultException in the following code snippet:

      if (!handlingErrorMethod.equalsIgnoreCase(FAULT_FLOW))

      { // HANDLE AS JBI FAULT throw new FaultException("Failed to validate against schema: " + schema, exchange, fault); }

      else

      { MessageUtil.transfer(fault, out); return true; }

      In the new servicemix-validation component, a JBIException is thrown instead of a FaultException. The relevant code snippet follows:

      if (!handlingErrorMethod.equalsIgnoreCase(FAULT_FLOW))

      { // HANDLE AS JBI FAULT throw new JBIException( "Failed to validate against schema: " + schema + "\n" + new SourceTransformer().toString(fault.getContent())); }

      else

      { MessageUtil.transfer(fault, out); }

      The new servicemix-validation component does not seem correct to me. It should throw a FaultException rather than a JBIException. I would suggest a unit test be written to verify this behavior.

      Ron

      Attachments

        Activity

          People

            lhe Lars Heinemann
            rgavlin Ron Gavlin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: