java.lang.NoSuchMethodError: java.io.IOException: method <init>(Ljava/lang/Throwable;)V not found

Jenkins JIRA | Angelo Cordova | 3 years ago
  1. 0
  2. 0
  3. 0

    For easier investigation, we reproduced our problem in the following minimal scenario: 1. We create a file main.c (attached to this report): int main() { return 0; } 2. We create a CppCheck report, cppcheck-result.xml, on main.c: cppcheck --xml main.c 2> cppcheck-result.xml Contents of cppcheck-result.xml (attached to this report): <?xml version="1.0" encoding="UTF-8"?> <results> </results> 3. We create a Jenking job for CppCheck. 4. We place cppcheck-result.xml (created in step 2) in the workspace of the Jenkins job. 5. In the Jenkins job configuration page: 5a. We specify no command for the build. 5b. We select "Publish Cppcheck results". 5c. In the box "Cppcheck report XMLs", we enter "**/cppcheck-result.xml". 5d. We leave the CppCheck plugin boxes "Use the workspace as root path to look for reports" and "Ignore blank files" unchecked. 5e. We do not touch the CppCheck plugin's "Advanced..." settings. 5f. We save the Jenkins job configuration. 6. We build manually the Jenking CppCheck job ("Build Now"). The build fails. The console output shows: [Cppcheck] Processing 1 files with the pattern '**/cppcheck-result.xml'. FATAL: java.io.IOException: method <init>(Ljava/lang/Throwable;)V not found java.lang.NoSuchMethodError: java.io.IOException: method <init>(Ljava/lang/Throwable;)V not found at org.jenkinsci.plugins.cppcheck.parser.CppcheckParser.parse(CppcheckParser.java:57) at org.jenkinsci.plugins.cppcheck.CppcheckParserResult.invoke(CppcheckParserResult.java:65) at org.jenkinsci.plugins.cppcheck.CppcheckParserResult.invoke(CppcheckParserResult.java:21) at hudson.FilePath.act(FilePath.java:758) at hudson.FilePath.act(FilePath.java:740) at org.jenkinsci.plugins.cppcheck.CppcheckPublisher.perform(CppcheckPublisher.java:62) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:682) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:657) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:635) at hudson.model.Build$RunnerImpl.post2(Build.java:161) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:604) at hudson.model.Run.run(Run.java:1400) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:175) 7. In the Jenkins job configuration page, we change the contents of the box "Cppcheck report XMLs" so it contains the absolute path to cppcheck-result.xml, and we save the Jenkins job configuration. 8. We build manually the Jenking CppCheck job ("Build Now"). The build fails again. The console output now shows a different error message: [Cppcheck] Starting the cppcheck analysis. [Cppcheck] Parsing throws exceptions. No cppcheck test report file(s) were found with the pattern '/absolute/path/to/cppcheck-result.xml' relative to '/absolute/path/to/workspace'. Did you enter a pattern relative to the correct directory? Did you generate the XML report(s) for Cppcheck? Build step 'Publish Cppcheck results' changed build result to FAILURE Build step 'Publish Cppcheck results' marked build as failure Finished: FAILURE What is wrong? Note that we are using the Cobertura Jenkins plugin (which also reads an XML input file), and it works perfectly. -- dave

    Jenkins JIRA | 5 years ago | Dave Ohlsson
    java.lang.NoSuchMethodError: java.io.IOException: method <init>(Ljava/lang/Throwable;)V not found
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    For easier investigation, we reproduced our problem in the following minimal scenario: 1. We create a file main.c (attached to this report): int main() { return 0; } 2. We create a CppCheck report, cppcheck-result.xml, on main.c: cppcheck --xml main.c 2> cppcheck-result.xml Contents of cppcheck-result.xml (attached to this report): <?xml version="1.0" encoding="UTF-8"?> <results> </results> 3. We create a Jenking job for CppCheck. 4. We place cppcheck-result.xml (created in step 2) in the workspace of the Jenkins job. 5. In the Jenkins job configuration page: 5a. We specify no command for the build. 5b. We select "Publish Cppcheck results". 5c. In the box "Cppcheck report XMLs", we enter "**/cppcheck-result.xml". 5d. We leave the CppCheck plugin boxes "Use the workspace as root path to look for reports" and "Ignore blank files" unchecked. 5e. We do not touch the CppCheck plugin's "Advanced..." settings. 5f. We save the Jenkins job configuration. 6. We build manually the Jenking CppCheck job ("Build Now"). The build fails. The console output shows: [Cppcheck] Processing 1 files with the pattern '**/cppcheck-result.xml'. FATAL: java.io.IOException: method <init>(Ljava/lang/Throwable;)V not found java.lang.NoSuchMethodError: java.io.IOException: method <init>(Ljava/lang/Throwable;)V not found at org.jenkinsci.plugins.cppcheck.parser.CppcheckParser.parse(CppcheckParser.java:57) at org.jenkinsci.plugins.cppcheck.CppcheckParserResult.invoke(CppcheckParserResult.java:65) at org.jenkinsci.plugins.cppcheck.CppcheckParserResult.invoke(CppcheckParserResult.java:21) at hudson.FilePath.act(FilePath.java:758) at hudson.FilePath.act(FilePath.java:740) at org.jenkinsci.plugins.cppcheck.CppcheckPublisher.perform(CppcheckPublisher.java:62) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:682) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:657) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:635) at hudson.model.Build$RunnerImpl.post2(Build.java:161) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:604) at hudson.model.Run.run(Run.java:1400) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:175) 7. In the Jenkins job configuration page, we change the contents of the box "Cppcheck report XMLs" so it contains the absolute path to cppcheck-result.xml, and we save the Jenkins job configuration. 8. We build manually the Jenking CppCheck job ("Build Now"). The build fails again. The console output now shows a different error message: [Cppcheck] Starting the cppcheck analysis. [Cppcheck] Parsing throws exceptions. No cppcheck test report file(s) were found with the pattern '/absolute/path/to/cppcheck-result.xml' relative to '/absolute/path/to/workspace'. Did you enter a pattern relative to the correct directory? Did you generate the XML report(s) for Cppcheck? Build step 'Publish Cppcheck results' changed build result to FAILURE Build step 'Publish Cppcheck results' marked build as failure Finished: FAILURE What is wrong? Note that we are using the Cobertura Jenkins plugin (which also reads an XML input file), and it works perfectly. -- dave

    Jenkins JIRA | 5 years ago | Dave Ohlsson
    java.lang.NoSuchMethodError: java.io.IOException: method <init>(Ljava/lang/Throwable;)V not found

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoSuchMethodError

      java.io.IOException: method <init>(Ljava/lang/Throwable;)V not found

      at org.jenkinsci.plugins.cppcheck.parser.CppcheckParser.parse()
    2. org.jenkinsci.plugins
      CppcheckParserResult.invoke
      1. org.jenkinsci.plugins.cppcheck.parser.CppcheckParser.parse(CppcheckParser.java:56)
      2. org.jenkinsci.plugins.cppcheck.CppcheckParserResult.invoke(CppcheckParserResult.java:66)
      3. org.jenkinsci.plugins.cppcheck.CppcheckParserResult.invoke(CppcheckParserResult.java:21)
      3 frames
    3. Hudson
      FilePath.act
      1. hudson.FilePath.act(FilePath.java:904)
      2. hudson.FilePath.act(FilePath.java:877)
      2 frames
    4. org.jenkinsci.plugins
      CppcheckPublisher.perform
      1. org.jenkinsci.plugins.cppcheck.CppcheckPublisher.perform(CppcheckPublisher.java:127)
      1 frame
    5. Hudson
      Executor.run
      1. hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      3. hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
      4. hudson.model.Build$BuildExecution.post2(Build.java:183)
      5. hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
      6. hudson.model.Run.execute(Run.java:1600)
      7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      8. hudson.model.ResourceController.execute(ResourceController.java:88)
      9. hudson.model.Executor.run(Executor.java:237)
      9 frames