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

NullPointerException despite report being in the directory

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The following build log shows that the report.html is in the directory that the step
      dependencyCheckPublisher is running on , and yet the step reports NullPointerException

      + pwd
      /var/jenkins_home/testws
      [Pipeline] sh (hide)
      + ls -lah results
      total 136K
      drwxr-sr-x 2 jenkins jenkins 4.0K Dec 18 07:50 .
      drwxr-sr-x 3 jenkins jenkins 4.0K Dec 18 07:50 ..
      -rw-r--r-- 1 jenkins jenkins 127K Dec 18 08:07 dependency-check-report.html
      [Pipeline] dependencyCheckPublisher
      [DependencyCheck] Collecting Dependency-Check artifact
      [DependencyCheck] Unable to parse /var/jenkins_home/testws/results/dependency-check-report.html
      [Pipeline] }
      [Pipeline] // ws
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      java.lang.NullPointerException
      	at org.jenkinsci.plugins.DependencyCheck.ConsoleLogger.log(ConsoleLogger.java:43)
      	at org.jenkinsci.plugins.DependencyCheck.DependencyCheckPublisher.perform(DependencyCheckPublisher.java:141)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE
      

        Attachments

          Activity

          Hide
          tom_gl Thomas de Grenier de Latour added a comment -

          The problem here is that you're pointing an HTML report instead of an XML report:

          [DependencyCheck] Unable to parse /var/jenkins_home/testws/results/dependency-check-report.html

          Since the .html is all you have in your results directory, I guess you're specifying the --format HTML parameter. Try adding --format XML too, you'll get both output files, and then point your publisher to dependency-check-report.xml (and you can use the Publish HTML report plugin to publish the HTML too if you want).

          The NPE simply looks like an unfortunate side effect of this error.

          Show
          tom_gl Thomas de Grenier de Latour added a comment - The problem here is that you're pointing an HTML report instead of an XML report: [DependencyCheck] Unable to parse /var/jenkins_home/testws/results/dependency-check-report.html Since the .html is all you have in your results directory, I guess you're specifying the --format HTML parameter. Try adding --format XML too, you'll get both output files, and then point your publisher to dependency-check-report.xml (and you can use the Publish HTML report plugin to publish the HTML too if you want). The NPE simply looks like an unfortunate side effect of this error.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            zackq ZackQ
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: