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

Missing support for interface/implementation separated JAXB classes in Jaxb2Marshaller

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.5.2
    • Fix Version/s: 1.5.4
    • Component/s: OXM
    • Labels:
      None

      Description

      When I generate my JAXB mappings, I use the <jaxb:globalBindings generateValueClass="false"> option in my binding configuration. This results in a separation of interfaces and implementation classes of my JAXB mapping, so I have a mypackage.jaxb.MyElement interface and a mypackage.jaxb.impl.MyElementImpl implementation class.

      Now about the problems:

      1) The Jaxb2Marshaller's supportsInternal() method checks, if the specified type contains a XmlRootElement - which is only present in the implementation, not in the interface. So I'm forced to use the mypackage.jaxb.impl.MyElementImpl class in my Endpoint instead of using the interface mypackage.jaxb.MyElement. Bug or feature?

      2) The contextPath check in the same method checks, if one of the specified contextPaths is exactly the same as the package of my JAXB element, which is not the case, because I have to specify the mypackage.jaxb package as the contextPath (because only this package contains the required ObjectFactory class) and the found type is in the mypackage.jaxb.impl package (because of problem 1).

      I hope I could explain the problem - if you have any questions, let me know.

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I don't see an way to support this feature without rewriting the entire supports mechanism, and breaking backwards compatibility.

        The easiest way for you to solve this would be to subclass Jaxb2Marshaller, and override the supports method to do what you want to.

        Show
        arjen.poutsma Arjen Poutsma added a comment - I don't see an way to support this feature without rewriting the entire supports mechanism, and breaking backwards compatibility. The easiest way for you to solve this would be to subclass Jaxb2Marshaller, and override the supports method to do what you want to.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            ojs Oliver Siegmar
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: