Spring Web Services
  1. Spring Web Services
  2. SWS-824

In v 2.1.0, dispatch method of MessageDispatcher does not call processEndpointException method if response schema validation fails

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.1.3
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows, Java 7

      Description

      I have upgraded spring web service library from 2.0 to 2.1 in my application. But after that overriden customizeFault method of ServiceFaultExceptionResolver class (which extends SimpleSoapExceptionResolver of Spring) does not get invoked from dispatch method of MessageDispatcherServllet class if exception is thrown from overriden handleResponseValidationErrors method of PayloadValidatingInterceptorWithException class (Which extends PayloadValidatingInterceptor of Spring).

      Now this works fine if I use v 2.0. But in v2.1, If exception is thrown from overriden handleResponseValidationErrors then control is coming to the second catch block of dispatch method which does not call processEndpointException. And processEndpointException is responsible to call all the fault resolver. second catch block is below:

      catch (Exception ex) {
      			// Trigger after-completion for thrown exception.
                  triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, ex);
                  throw ex;
              }
      

      If exception is thrown from overriden handleRequestValidationErrors method of PayloadValidatingInterceptorWithException ( which extends PayloadValidatingInterceptor of Spring) then control comes to the first catch block(Please see below) of dispatch method and that calls processEndpointException - So everything is fine for request schema validation fail scenario

      catch (Exception ex) {
                      Object endpoint = mappedEndpoint != null ? mappedEndpoint.getEndpoint() : null;
                      processEndpointException(messageContext, endpoint, ex);
                  }  
      

      But In v 2.0 there is only one catch block in dispatch method for all the code and that catch block calls processEndpointException - So both request and response schema validation scenario works fine with v2.0.

      So change of exception handling in dispatch method of v2.1 is breaking my application.

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Arjen Poutsma
              Reporter:
              Subhajit Raha
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: