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

Jaxb2Marshaller::supports method does not consider multiple marshallers

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.0.2
    • Component/s: OXM
    • Labels:
      None

      Description

      When evaluating multiple MarshallingMethodEndpointAdapters, each with their own Jaxb2MarshallingEndpoint, the first MarshallingMethodEndpointAdapter::supports method is always true.

      We are building a modular application; where each endpoint is packaged as it's own module.
      Each of those endpoint modules has it's own MarshallingMethodEndpointAdapter and it's own Jaxb2Marshaller.
      This means that when the webapp is packaged and running there will be multiple MarshallingMethodEndpointAdapters available to the MessageDispatcher.

      The Jaxb2Marshaller::supports method is implemented to return true for any subclass of Jaxb2Element.

          public boolean supports(Class clazz) {
              if (JAXBElement.class.isAssignableFrom(clazz)) {
                  return true;
              }
              ...
          }
      

      The Jaxb2Marshaller should not even bother with this check, it should only return true if the JaxbContext is capable of supporting the given class.

        Attachments

          Activity

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              raykrueger Ray Krueger
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: