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

Missing support for interface/implementation separated JAXB classes in Jaxb2Marshaller


    • 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:


      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.




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


              • Created: