[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 Fri Aug 17 17:19:40 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.