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

ArrayIndexOutOfBoundsException when trying to publish the Jacoco report

    Details

    • Similar Issues:

      Description

      [JaCoCo plugin] Collecting JaCoCo coverage data...
      [JaCoCo plugin] */target/.exec;/target/classes;*/src/main/java; locations are configured
      [JaCoCo plugin] Number of found exec files: 1
      [JaCoCo plugin] Saving matched execfiles: /var/jenkins/workspace/fxtb-dev-Trade/target/jacoco.exec
      [JaCoCo plugin] Saving matched class directories: /var/jenkins/workspace/fxtb-dev-Trade/target/classes
      [JaCoCo plugin] Saving matched source directories: /var/jenkins/workspace/fxtb-dev-Trade/src/main/java
      [JaCoCo plugin] Loading inclusions files..
      ERROR: Publisher hudson.plugins.jacoco.JacocoPublisher aborted due to exception
      java.lang.ArrayIndexOutOfBoundsException: 0
      at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:117)
      at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:137)
      at hudson.plugins.jacoco.JacocoBuildAction.getJacocoReports(JacocoBuildAction.java:249)
      at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:332)
      at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:313)
      at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:363)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:807)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:782)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:994)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:729)
      at hudson.model.Run.execute(Run.java:1541)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:236)
      Performing Post build task...

        Attachments

          Activity

          Hide
          ognjenb Ognjen Bubalo added a comment -

          I created a quickfix, please test it before I release it.

          To test the build:
          Stop the Jenkins instance. In the Jenkins\plugins\ delete the jacoco dir, jacoco.hpi and create an empty "jacoco.hpi.pinned" file. Then copy this .hpi file into the plugins dir and lunch Jenkins.

          Show
          ognjenb Ognjen Bubalo added a comment - I created a quickfix, please test it before I release it. To test the build: Stop the Jenkins instance. In the Jenkins\plugins\ delete the jacoco dir, jacoco.hpi and create an empty "jacoco.hpi.pinned" file. Then copy this .hpi file into the plugins dir and lunch Jenkins.
          Hide
          marcell Marcel L added a comment -

          No joy with the hotfix version:

           
          [JaCoCo plugin] Collecting JaCoCo coverage data...
          [JaCoCo plugin] **/buildReports/*.exec;**/bin/debugclasses;**/src; locations are configured
          [JaCoCo plugin] Number of found exec files: 1
          
          [JaCoCo plugin] Saving matched execfiles:  /<Hidden>/buildReports/jacoco.exec
          [JaCoCo plugin] Saving matched class directories:  /<Hidden>/bin/debugclasses
          [JaCoCo plugin] Saving matched source directories:  /<Hidden>/src
          [JaCoCo plugin] Loading inclusions files..
          ERROR: Publisher hudson.plugins.jacoco.JacocoPublisher aborted due to exception
          java.lang.ArrayIndexOutOfBoundsException: 0
          	at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:127)
          	at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:143)
          	at hudson.plugins.jacoco.JacocoBuildAction.getJacocoReports(JacocoBuildAction.java:249)
          	at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:332)
          	at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:313)
          	at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:363)
          	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:810)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:785)
          	at hudson.ivy.IvyModuleSetBuild$RunnerImpl.post2(IvyModuleSetBuild.java:587)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:732)
          	at hudson.model.Run.execute(Run.java:1593)
          	at hudson.model.Run.run(Run.java:1514)
          	at hudson.ivy.IvyModuleSetBuild.run(IvyModuleSetBuild.java:282)
          	at hudson.model.ResourceController.execute(ResourceController.java:88)
          	at hudson.model.Executor.run(Executor.java:236)
          Recording fingerprints
          

          But I can confirm Tims workaround (entered something in the "Inclusions" section). Then the project builds fine but the build becomes unstable due to jacoco. Can someone tell me why ?

           
          Recording test results
          [JaCoCo plugin] Collecting JaCoCo coverage data...
          [JaCoCo plugin] **/buildReports/*.exec;**/bin/debugclasses;**/src; locations are configured
          [JaCoCo plugin] Number of found exec files: 1
          [JaCoCo plugin] Saving matched execfiles:  /<Hidden>/buildReports/jacoco.exec
          [JaCoCo plugin] Saving matched class directories:  /<Hidden>/bin/debugclasses
          [JaCoCo plugin] Saving matched source directories:  /<Hidden>/src
          [JaCoCo plugin] Loading inclusions files..
          [JaCoCo plugin] inclusions: [**/*.class]
          [JaCoCo plugin] exclusions: []
          
          [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=100, minMethod=0, maxMethod=70, minLine=0, maxLine=80, minBranch=0, maxBranch=80, minInstruction=0, maxInstruction=80, minComplexity=0, maxComplexity=80]
          [JaCoCo plugin] Publishing the results..
          
          [JaCoCo plugin] Loading packages..
          [JaCoCo plugin] Done.
          Build step 'Record JaCoCo coverage report' changed build result to UNSTABLE
          Finished: UNSTABLE
          
          Show
          marcell Marcel L added a comment - No joy with the hotfix version: [JaCoCo plugin] Collecting JaCoCo coverage data... [JaCoCo plugin] **/buildReports /*.exec;**/ bin/debugclasses;**/src; locations are configured [JaCoCo plugin] Number of found exec files: 1 [JaCoCo plugin] Saving matched execfiles: /<Hidden>/buildReports/jacoco.exec [JaCoCo plugin] Saving matched class directories: /<Hidden>/bin/debugclasses [JaCoCo plugin] Saving matched source directories: /<Hidden>/src [JaCoCo plugin] Loading inclusions files.. ERROR: Publisher hudson.plugins.jacoco.JacocoPublisher aborted due to exception java.lang.ArrayIndexOutOfBoundsException: 0 at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:127) at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:143) at hudson.plugins.jacoco.JacocoBuildAction.getJacocoReports(JacocoBuildAction.java:249) at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:332) at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:313) at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:363) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:810) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:785) at hudson.ivy.IvyModuleSetBuild$RunnerImpl.post2(IvyModuleSetBuild.java:587) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:732) at hudson.model.Run.execute(Run.java:1593) at hudson.model.Run.run(Run.java:1514) at hudson.ivy.IvyModuleSetBuild.run(IvyModuleSetBuild.java:282) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236) Recording fingerprints But I can confirm Tims workaround (entered something in the "Inclusions" section). Then the project builds fine but the build becomes unstable due to jacoco. Can someone tell me why ? Recording test results [JaCoCo plugin] Collecting JaCoCo coverage data... [JaCoCo plugin] **/buildReports /*.exec;**/ bin/debugclasses;**/src; locations are configured [JaCoCo plugin] Number of found exec files: 1 [JaCoCo plugin] Saving matched execfiles: /<Hidden>/buildReports/jacoco.exec [JaCoCo plugin] Saving matched class directories: /<Hidden>/bin/debugclasses [JaCoCo plugin] Saving matched source directories: /<Hidden>/src [JaCoCo plugin] Loading inclusions files.. [JaCoCo plugin] inclusions: [**/*.class] [JaCoCo plugin] exclusions: [] [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=100, minMethod=0, maxMethod=70, minLine=0, maxLine=80, minBranch=0, maxBranch=80, minInstruction=0, maxInstruction=80, minComplexity=0, maxComplexity=80] [JaCoCo plugin] Publishing the results.. [JaCoCo plugin] Loading packages.. [JaCoCo plugin] Done. Build step 'Record JaCoCo coverage report' changed build result to UNSTABLE Finished: UNSTABLE
          Hide
          ognjenb Ognjen Bubalo added a comment -

          Hi Marcel,

          It is because of the set thresholds:
          https://groups.google.com/d/topic/jenkins-jacoco-plugin-mailing-list/pzHm98RJjB8/discussion

          Hmm, interesting. I'll find a better way to fix this issue. The workaround works for sure.

          Cheers,
          Ogi

          Show
          ognjenb Ognjen Bubalo added a comment - Hi Marcel, It is because of the set thresholds: https://groups.google.com/d/topic/jenkins-jacoco-plugin-mailing-list/pzHm98RJjB8/discussion Hmm, interesting. I'll find a better way to fix this issue. The workaround works for sure. Cheers, Ogi
          Hide
          ognjenb Ognjen Bubalo added a comment -

          New release will fix it

          Show
          ognjenb Ognjen Bubalo added a comment - New release will fix it
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ognjen Bubalo
          Path:
          src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java
          http://jenkins-ci.org/commit/jacoco-plugin/f0843cc3a2ff21d5b2f5676753929192e17cdf61
          Log:
          Fixing

          JENKINS-16777
          ArrayIndexOutOfBoundsException when trying to publish the Jacoco report

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ognjen Bubalo Path: src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java http://jenkins-ci.org/commit/jacoco-plugin/f0843cc3a2ff21d5b2f5676753929192e17cdf61 Log: Fixing JENKINS-16777 ArrayIndexOutOfBoundsException when trying to publish the Jacoco report

            People

            • Assignee:
              ognjenb Ognjen Bubalo
              Reporter:
              hochraldo Mario Hochreiter
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: