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

NPE when parsing FindBugs 2.0.0 output file with fb-contrib plugin enabled

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: findbugs-plugin
    • Labels:
      None
    • Environment:
      Scientific Linux 6 64-bit
    • Similar Issues:

      Description

      When using FindBugs 2.0.0, and the fb-contrib plugin is enabled, the Jenkins plugin gets an NPE when parsing the resulting XML file, causing the build to fail:

      [FINDBUGS] Collecting findbugs analysis files...
      ERROR: Publisher hudson.plugins.findbugs.FindBugsPublisher aborted due to exception
      java.lang.NullPointerException
      at edu.umd.cs.findbugs.Project.setPluginStatus(Project.java:130)
      at edu.umd.cs.findbugs.SAXBugCollectionHandler.startElement(SAXBugCollectionHandler.java:384)
      at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at edu.umd.cs.findbugs.SortedBugCollection.doReadXML(SortedBugCollection.java:356)
      at edu.umd.cs.findbugs.SortedBugCollection.doReadXML(SortedBugCollection.java:327)
      at edu.umd.cs.findbugs.SortedBugCollection.readXML(SortedBugCollection.java:314)
      at hudson.plugins.findbugs.parser.FindBugsParser.readXml(FindBugsParser.java:263)
      at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:206)
      at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:143)
      at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:103)
      at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:358)
      at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:317)
      at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:266)
      at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31)
      at hudson.FilePath.act(FilePath.java:756)
      at hudson.FilePath.act(FilePath.java:738)
      at hudson.plugins.findbugs.FindBugsPublisher.perform(FindBugsPublisher.java:158)
      at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:338)
      at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:662)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:638)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:616)
      at hudson.model.Build$RunnerImpl.post2(Build.java:161)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:585)
      at hudson.model.Run.run(Run.java:1398)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:145)
      [WARNINGS] Skipping publisher since build result is FAILURE

      The plugin section of the XML file looks something like this:

      <?xml version="1.0" encoding="UTF-8"?>

      <BugCollection version="2.0.0" sequence="0" timestamp="1325796064745" analysisTimestamp="1325796064756" release="">
      <Project projectName="">

      ....

      <Plugin id="com.mebigfatguy.fbcontrib" enabled="true"/>
      </Project>

        Attachments

          Activity

          Hide
          drulli Ulli Hafner added a comment -

          Seems that this is a bug in the findbugs library itself (which I am using to read the files). I will upgrade my parser to the 2.0.0 release and see if that solves the problem...

          Show
          drulli Ulli Hafner added a comment - Seems that this is a bug in the findbugs library itself (which I am using to read the files). I will upgrade my parser to the 2.0.0 release and see if that solves the problem...
          Hide
          wpugh Bill Pugh added a comment - - edited

          OK, looks like you are using a pre 2.0.0 release version of FindBugs. Try using 2.0.0, and report if you have any problems doing so.

          Show
          wpugh Bill Pugh added a comment - - edited OK, looks like you are using a pre 2.0.0 release version of FindBugs. Try using 2.0.0, and report if you have any problems doing so.
          Hide
          drulli Ulli Hafner added a comment -

          Robert, can you please attach your generated findbugs.xml file? Then I can use it as input for a test case.

          Show
          drulli Ulli Hafner added a comment - Robert, can you please attach your generated findbugs.xml file? Then I can use it as input for a test case.
          Hide
          drulli Ulli Hafner added a comment -

          Ok, I now upgraded to findbugs 2.0.0. Can you please check, if that solves your problem?

          See: http://ci.jenkins-ci.org/job/plugins_findbugs/376/

          Show
          drulli Ulli Hafner added a comment - Ok, I now upgraded to findbugs 2.0.0. Can you please check, if that solves your problem? See: http://ci.jenkins-ci.org/job/plugins_findbugs/376/
          Hide
          robhancock Robert Hancock added a comment -

          Here is a sample findbugs XML file with the fb-contrib plugin enabled.

          Show
          robhancock Robert Hancock added a comment - Here is a sample findbugs XML file with the fb-contrib plugin enabled.
          Hide
          robhancock Robert Hancock added a comment -

          Yes, the build you provided appears to fix the issue.

          Show
          robhancock Robert Hancock added a comment - Yes, the build you provided appears to fix the issue.
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_findbugs #377
          [FIXED JENKINS-12314] Upgrade to findbugs 2.0.0.

          Ulli Hafner :
          Files :

          • plugin/src/main/resources/hudson/plugins/findbugs/messages.xml
          • plugin/src/main/resources/hudson/plugins/findbugs/messages_fr.xml
          • plugin/src/test/java/hudson/plugins/findbugs/parser/FindBugsParserTest.java
          • plugin/.classpath
          • plugin/src/main/resources/hudson/plugins/findbugs/messages_ja.xml
          • plugin/src/test/resources/hudson/plugins/findbugs/parser/issue12314.xml
          • plugin/src/test/java/hudson/plugins/findbugs/FindBugsMessagesTest.java
          Show
          dogfood dogfood added a comment - Integrated in plugins_findbugs #377 [FIXED JENKINS-12314] Upgrade to findbugs 2.0.0. Ulli Hafner : Files : plugin/src/main/resources/hudson/plugins/findbugs/messages.xml plugin/src/main/resources/hudson/plugins/findbugs/messages_fr.xml plugin/src/test/java/hudson/plugins/findbugs/parser/FindBugsParserTest.java plugin/.classpath plugin/src/main/resources/hudson/plugins/findbugs/messages_ja.xml plugin/src/test/resources/hudson/plugins/findbugs/parser/issue12314.xml plugin/src/test/java/hudson/plugins/findbugs/FindBugsMessagesTest.java

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              robhancock Robert Hancock
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: