[SWS-772] <sws:annotation-driven/> should register a SoapFaultAnnotationExceptionResolver Created: 08/May/12  Updated: 27/Sep/13  Resolved: 08/May/12

Status: Resolved
Project: Spring Web Services
Component/s: Core
Affects Version/s: 2.0.3
Fix Version/s: 2.1 RC1

Type: Improvement Priority: Minor
Reporter: Pavel Tcholakov Assignee: Arjen Poutsma
Resolution: Complete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 0.25h
Original Estimate: Not Specified

Issue Links:
is related to SWS-777 SoapFaultMappingExceptionResolver not... Resolved
is related to SWS-793 Extending SoapFaultAnnotationExceptio... Resolved


I would expect adding an <sws:annotation-driven/> element to automatically honour @SoapFault-annotated exceptions, however it doesn't do this. One has to declare a SoapFaultAnnotationExceptionResolver bean separately in order for this to work. Is there any situation in which annotation-driven endpoints are desirable, but annotated faults are not?

Comment by Arjen Poutsma [ 08/May/12 ]

You're right, it was an oversight to not include the SoapFaultAnnotationExceptionResolver.

Comment by Arjen Poutsma [ 29/May/12 ]

Note that due to this change, you might be required to set "order" property values on custom ExceptionResolvers.

This is due to the fact that <sws:annotation-driven/> now adds the SoapFaultAnnotationExceptionResolver (with order 0) and SimpleSoapExceptionResolver (Ordered.LOWEST_PRECEDENCE). Formerly, these two were also registered, but only if you did not have any "custom" exception resolvers in the application context. As such, if you do have custom exception resolvers in the application context (such as the SoapFaultMappingExceptionResolver), you have to make sure they act before the ones provided by <sws:annotation-driven/>, or at least before the SimpleSoapExceptionResolver (which always resolves the exception, making it suitable as a fallback mechanism, hence the low precedence).

Comment by Hans-Peter Störr [ 27/Sep/13 ]

It would be very nice if the documentation would actually mention this somewhere. I was just tearing out some of my already receding hair trying to find out where that SoapFaultAnnotationExceptionResolver suddenly came, that broke our exception handling after upgrading to spring-ws 2.1. 8-) I only found out about it when googling and finding the changelog. Perhaps you can mention it in the chapter about the SoapFaultAnnotationExceptionResolver, and also mention how to get rid of it if you don't need it. Setting the order of your own exceptionresolvers to negative values seems to be a reasonable way to do this.

By the way: even setting the logging of the whole spring framework to trace did not give me any clue where it comes from. Shouldn't there be some log message about that? Perhaps it would be even better if there was a message about each bean where the bean definition comes from.

Generated at Wed Nov 14 13:12:18 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.