• Icon: Sub-task Sub-task
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • None
    • xml
    • None
    • generic
    • generic

      Calling JAXBContext#newInstance(Class[] classesToBeBound) and JAXBContext#newInstance(Class[] classesToBeBound, Map<String,?> properties ) with classes from java.base as parameters for "classesToBeBound" causes JAXBException, with following description:
      Package java.lang with JAXB class (class name) defined in a module java.base must be open to at least java.xml.bind module.

      Generally passing java.base classes to JAXBContext is unnecessary and should be avoided with an exception for using javax.xml.bind.JAXBElement with an array as its root type.

      Workaround: declare openness propagation for those explicitly with --add-opens
      For example:
      --add-opens java.base/java.lang=java.xml.bind

            zli Zheng Jun Li (Inactive)
            rgrigoriadi Roman Grigoriadi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: