Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55620

SloccountPublisher fails on Java 11 without --add-modules java.xml.bind



    • Similar Issues:
    • Released As:
      JAXB Plugin


      Using a Jenkins running on Java 11 (Java 11 support is currently in preview (https://jenkins.io/blog/2018/12/14/java11-preview-availability/), SloccountPublisher throws the following exception while generating the report.

      janv. 16, 2019 2:26:14 PM hudson.model.AbstractBuild$AbstractBuildExecution reportError
      WARNING: Step ‘Publish SLOCCount analysis results’ aborted due to exception: 
      java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
              at hudson.plugins.sloccount.SloccountPublisher.perform(SloccountPublisher.java:82)
              at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
              at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
              at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
              at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
              at hudson.model.Build$BuildExecution.post2(Build.java:186)
              at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
              at hudson.model.Run.execute(Run.java:1835)
              at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
              at hudson.model.ResourceController.execute(ResourceController.java:97)
              at hudson.model.Executor.run(Executor.java:429)
      Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
              at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1374)
              at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1327)
              at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1080)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
              ... 11 more

      Expected behavior

      Though there is ongoing work to see how/if to keep making JAXB usages in Jenkins on Java 11+, it would be nice if the plugin code could be analyzed to see if it could work without depending on JAXB API (which has been removed from the JDK starting from Java 9+).

      Technical consideration

      Looking at the code quickly, I think the main (only?) reason JAXB usage is to marshall/unmarshall the ClocReport.

      I think replacing the serialization with an XStream marshalling would probably achieve the same thing, while removing the JAXB dependency.


          Issue Links


            batmat Baptiste Mathus created issue -
            batmat Baptiste Mathus made changes -
            Field Original Value New Value
            Labels java11 java11-compatibility fosdem2019 java11 java11-compatibility
            batmat Baptiste Mathus made changes -
            Link This issue relates to JENKINS-51965 [ JENKINS-51965 ]
            batmat Baptiste Mathus made changes -
            Remote Link This issue links to "PR (Web Link)" [ 22213 ]
            vilacides Isa Vilacides made changes -
            Labels fosdem2019 java11 java11-compatibility fosdem2019 java11 java11-compatibility triaged
            batmat Baptiste Mathus made changes -
            Link This issue relates to JENKINS-55681 [ JENKINS-55681 ]
            oleg_nenashev Oleg Nenashev made changes -
            Released As JAXB Plugin
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
            oleg_nenashev Oleg Nenashev made changes -
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]


              npiguet npiguet
              batmat Baptiste Mathus
              0 Vote for this issue
              6 Start watching this issue