Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-754

EndpointInterceptor.afterCompletion is not always invoked

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.5
    • Component/s: Core
    • Labels:
      None

      Description

      afterCompletion's javadoc states that it will be called on any outcome of endpoint invocation, allowing for proper resource cleanup. There is however a case where handleRequest() successfully completes, but afterCompletion() is never invoked. This happens whenever an exception occurs and no EndpointExceptionResolver is able to resolve the exception.

      MessageDispatcher.java

      // within dispatch()'s last catch block
      catch (Exception ex) {
        Object endpoint = mappedEndpoint != null ? mappedEndpoint.getEndpoint() : null;
        processEndpointException(messageContext, endpoint, ex); // exception is rethrown here..
        triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext);
        triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, ex); // .. and afterCompletion() is never invoked
      }

        Issue Links

          Activity

          arjen.poutsma Arjen Poutsma logged work - 02/May/12 7:09 AM
          • Time Spent:
            47m
             
            <No comment>

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              larshvile Lars Hvile
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 47m
                47m