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

<sws:annotation-driven/> should register a SoapFaultAnnotationExceptionResolver

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.1 RC1
    • Component/s: Core
    • Labels:
      None

      Description

      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?

        Issue Links

          Activity

          Hide
          Arjen Poutsma added a comment -

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

          Show
          Arjen Poutsma added a comment - You're right, it was an oversight to not include the SoapFaultAnnotationExceptionResolver.
          Hide
          Arjen Poutsma added a comment -

          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).

          Show
          Arjen Poutsma added a comment - 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).
          Hide
          Hans-Peter Störr added a comment -

          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.

          Show
          Hans-Peter Störr added a comment - 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.

            People

            • Assignee:
              Arjen Poutsma
              Reporter:
              Pavel Tcholakov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 0.25h
                0.25h