Uploaded image for project: 'OpenNMS Horizon'
  1. OpenNMS Horizon
  2. HZN-1082

Missing java.xml.bind.* classes when compiling under Java 9

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 21.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Compiling with Java 9-ea+171 currently fails with:

      [ERROR] Failed to execute goal org.opennms.maven.plugins:features-maven-plugin:1.2.0:generate-features-xml (features.xml) on project org.opennms.container.jaa s-login-module: Execution features.xml of goal org.opennms.maven.plugins:features-maven-plugin:1.2.0:generate-features-xml failed: A required class was missing while executing org.opennms.maven.plugins:features-maven-plugin:1.2.0:generate-features-xml: javax/xml/bind/JAXBException
      

      Adding --add-modules=ALL-SYSTEM to the MAVEN_OPTS variable via bin/functions.pl resolves this particular problem, but I'm not sure that's the proper way to solve this. If we do chose this approach, we'll need to set that variable only when using Java 9+.

        Issue Links

          Activity

          Hide
          seth Seth Leger added a comment -

          According to the JCP and this post:

          http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-May/004309.html

          the following JavaEE packages are not accessible by default:

          java.activation
          java.annotations.common
          java.corba
          java.transaction
          java.xml.bind
          java.xml.ws
          

          It seems like we'll have to add any of these that we use with an --add-modules flag for build time and runtime. Another option would be to add a specific version of the JAXB API as a runtime dependency for the features-maven-plugin but there are probably more places where we'll need java.xml.bind.

          Show
          seth Seth Leger added a comment - According to the JCP and this post: http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-May/004309.html the following JavaEE packages are not accessible by default: java.activation java.annotations.common java.corba java.transaction java.xml.bind java.xml.ws It seems like we'll have to add any of these that we use with an --add-modules flag for build time and runtime. Another option would be to add a specific version of the JAXB API as a runtime dependency for the features-maven-plugin but there are probably more places where we'll need java.xml.bind.
          Show
          j-white Jesse White added a comment - PR: https://github.com/OpenNMS/opennms/pull/1554

            People

            • Assignee:
              j-white Jesse White
              Reporter:
              j-white Jesse White
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development

                  Agile