Details

    • Type: Sub-task
    • Status: Closed
    • Priority: P4
    • Resolution: Delivered
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: xml
    • Subcomponent:
    • Verification:
      Verified

      Description

      `JAXBContext` specifies that classes annotated with `@XmlRootType` should be specified at context creation time to `JAXBContext.newInstance(Class[] classesToBeBound, ...)`

      If the client classes are in a named module, than openness of the packages containing these classes is not propagated correctly when the root JAXB classes reference JAXB types in another package.

      For example, given the following Java classes:

      `@XmlRootElement2 class Foo { Bar b;} `
      `@XmlType class Bar { FooBar fb;} `
      `@XmlType class FooBar { int x; } `

      The invocation of `JAXBContext.newInstance(Foo.class`) registers `Foo` and the statically referenced classes, `Bar` and `FooBar.`

      If `Bar` and `FooBar` are in different package than `Foo`, than openness is not propagated for them with current implementation.

      The issue can be worked around by opening the package with the `opens` directive in the module declaration. Alternatively, the `--add-opens` command line option can be used to open the package:

      For example:
      `--add-opens foo.mymodule/bar.baz=ALL-UNNAMED` (for JAXB-RI on classpath)
      `--add-opens foo.mymodule/bar.baz=<jaxb-impl>` (for JABX implementations on the application module path)

        Attachments

          Activity

            People

            • Assignee:
              rgrigoriadi Roman Grigoriadi
              Reporter:
              rgrigoriadi Roman Grigoriadi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: