[SWS-754] EndpointInterceptor.afterCompletion is not always invoked Created: 20/Feb/12  Updated: 15/Apr/13  Resolved: 02/May/12

Status: Closed
Project: Spring Web Services
Component/s: Core
Affects Version/s: 2.0.4
Fix Version/s: 2.0.5

Type: Bug Priority: Major
Reporter: Lars Hvile Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 47m
Original Estimate: Not Specified

Issue Links:
Relate
is related to SWS-824 In v 2.1.0, dispatch method of Messag... Resolved

 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
}



 Comments   
Comment by Arjen Poutsma [ 02/May/12 ]

Fixed. Thanks for spotting this!

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Thu Dec 14 06:14:43 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.