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

NoEndpointFoundException swallowed by WebServiceMessageReceiverObjectSupport

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.2.RC1
    • Component/s: Core
    • Labels:
      None

      Description

      Most HTTP level exceptions, such as XML parsing issues, can be handled by writing a custom WebServiceMessageHandlerAdapter that converts them to, for example, SOAP faults. However, NoEndpointFoundException is swallowed by WebServiceMessageReceiverObjectSupport class so that it is not thrown:

      catch (NoEndpointFoundException ex) {
      if (connection instanceof EndpointAwareWebServiceConnection)

      { ((EndpointAwareWebServiceConnection) connection).endpointNotFound(); }

      }

      this is in final method handleConnection(), so it cannot be overridden either. Instead, a handle adapter must re-implement this whole method if NoEndpointFoundException is wanted to be converted to SOAP Fault. Either the exception should be re-thrown or there needs to be an extension point.

        Activity

        Hide
        slsh Jarkko Rantavuori added a comment -

        looks like a simple add of throw at the end of 'catch' would fix this:

                catch (NoEndpointFoundException ex) {
                    if (connection instanceof EndpointAwareWebServiceConnection) {
                        ((EndpointAwareWebServiceConnection) connection).endpointNotFound();
                    }
                    throw ex;
                }

        Show
        slsh Jarkko Rantavuori added a comment - looks like a simple add of throw at the end of 'catch' would fix this: catch (NoEndpointFoundException ex) { if (connection instanceof EndpointAwareWebServiceConnection) { ((EndpointAwareWebServiceConnection) connection).endpointNotFound(); } throw ex; }
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I'm afraid that rethrowing the exception is not an option, as that would break a lot of transports. The NoEndpointFoundException is meant to be dealt with by the transport.

        That said, I've refactored the code so that the handling of the exception is now in a template method (WebServiceMessageReceiverObjectSupport#handleNoEndpointFoundException), which you can override in your subclass.

        Show
        arjen.poutsma Arjen Poutsma added a comment - I'm afraid that rethrowing the exception is not an option, as that would break a lot of transports. The NoEndpointFoundException is meant to be dealt with by the transport. That said, I've refactored the code so that the handling of the exception is now in a template method (WebServiceMessageReceiverObjectSupport#handleNoEndpointFoundException), which you can override in your subclass.

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            slsh Jarkko Rantavuori
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: