jaxb
  1. jaxb
  2. JAXB-875

Import schema (via multiple transitive path) causes error of "'XxxType' is already defined", when episode feature comes in play.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.4u1
    • Fix Version/s: None
    • Component/s: xjc
    • Labels:
      None

      Description

      I'm using maven-jaxb2-plugin to generate Java classes from schema files, and want to put the schema files into different modules, using its episode feature.

      The same set of schema files can be compiled altogether in one shot without issue. But when split them into two modules, the issue surfaces. The <import/> relationship among my schema files is comparatively complex.

      The issue turns out to be rooted in the jaxb-xjc (Sun RI), the version I've tested is 2.2.4u1.

      Please use the attached maven project to reproduce the issue. It's stemmed from a real project.

      I've patched the class NGCCRuntimeEx in jaxb-xjc version 2.2.4u1. That patch is just the starting point of fixing the issue, and it works for me. It may not be the right/ultimate solution though. The basic idea is to enhance the ParserContext to remember what schemas have been imported.

        Activity

        Hide
        Iaroslav Savytskyi added a comment -

        No, no The project isn't abandoned.
        Let me check what can I do with this.

        Show
        Iaroslav Savytskyi added a comment - No, no The project isn't abandoned. Let me check what can I do with this.
        Hide
        Michael Osipov added a comment -

        Can't wait to test a fix. That would probably solve a serious wsimport bug.

        Show
        Michael Osipov added a comment - Can't wait to test a fix. That would probably solve a serious wsimport bug.
        Hide
        Niels Bertram added a comment -

        Looks like JAXB is truly abandoned. The problem is within XSOM and that library is baked into the JAXB RI build process last time I checked. The original fix proposed by phantom_john fixes the issue. Will anyone care if I submit a pull request for XSOM and JAXB-RI to incorporate the patch documented at https://github.com/bertramn/xsom-patch ?

        Show
        Niels Bertram added a comment - Looks like JAXB is truly abandoned. The problem is within XSOM and that library is baked into the JAXB RI build process last time I checked. The original fix proposed by phantom_john fixes the issue. Will anyone care if I submit a pull request for XSOM and JAXB-RI to incorporate the patch documented at https://github.com/bertramn/xsom-patch ?
        Hide
        Michael Osipov added a comment -

        Niels Bertram, this is so annoying. I'd like to test your patch but I am really sick of maintaining a fork of every single component Oracle is not capable/ or unwilling to fix. Let me have a look at it later that week and I will come back to you.

        Show
        Michael Osipov added a comment - Niels Bertram , this is so annoying. I'd like to test your patch but I am really sick of maintaining a fork of every single component Oracle is not capable/ or unwilling to fix. Let me have a look at it later that week and I will come back to you.
        Hide
        Niels Bertram added a comment -

        Agreed, especially if there is no real workaround and the patching is not really trivial given one has to first patch the xsom library and then also stuff around in about 35 locations in the JAXB-RI pom model to get this thing to shade the patched xsom code in. I did see that the JAXB-RI maven build is slowly getting "uncoupled" under the glassfish banner. Maybe some day we would just be able to maven exclude the defective xsom library from jaxb-xjc and add a fixed one to the dependencies section. This ticket is slowly becoming a larger issue for us in building component based JAXB binding modules so maybe we collectively need to raise Oracle Support tickets.

        Show
        Niels Bertram added a comment - Agreed, especially if there is no real workaround and the patching is not really trivial given one has to first patch the xsom library and then also stuff around in about 35 locations in the JAXB-RI pom model to get this thing to shade the patched xsom code in. I did see that the JAXB-RI maven build is slowly getting "uncoupled" under the glassfish banner. Maybe some day we would just be able to maven exclude the defective xsom library from jaxb-xjc and add a fixed one to the dependencies section. This ticket is slowly becoming a larger issue for us in building component based JAXB binding modules so maybe we collectively need to raise Oracle Support tickets.

          People

          • Assignee:
            Martin Grebac
            Reporter:
            phantom_john
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: