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

Cppcheck plugin can't connect to report file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Incomplete
    • Component/s: cppcheck-plugin
    • Labels:
    • Environment:
      OS: Centos 5.8; Jenkins version: 1.513; Cppcheck plugin version: 1.15; java version: 1.5.0_16
    • Similar Issues:

      Description

      the job build fails because the plugin can't access or can't connect with report.

      Console shows:

      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:56)
      at org.jenkinsci.plugins.cppcheck.CppcheckParserResult.invoke(CppcheckParserResult.java:66)
      at org.jenkinsci.plugins.cppcheck.CppcheckParserResult.invoke(CppcheckParserResult.java:21)
      at hudson.FilePath.act(FilePath.java:904)
      at hudson.FilePath.act(FilePath.java:877)
      at org.jenkinsci.plugins.cppcheck.CppcheckPublisher.perform(CppcheckPublisher.java:127)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
      at hudson.model.Run.execute(Run.java:1600)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:237)

        Attachments

        1. cppcheck.hpi
          1.20 MB
        2. cppcheck.hpi
          1.20 MB

          Issue Links

            Activity

            Hide
            mixalturek Michal Turek added a comment - - edited

            The same issue is present in JENKINS-11354 and in JENKINS-1087. It is caused by using constructor IOException(Throwable cause) introduced in Java 1.6 (compile time) in Java 1.5 (run time).

                    try {
                        jc.set(JAXBContext.newInstance(
                                org.jenkinsci.plugins.cppcheck.model.Error.class,
                                org.jenkinsci.plugins.cppcheck.model.Errors.class,
                                org.jenkinsci.plugins.cppcheck.model.Cppcheck.class,
                                org.jenkinsci.plugins.cppcheck.model.Results.class));
                        Unmarshaller unmarshaller = jc.get().createUnmarshaller();
                        org.jenkinsci.plugins.cppcheck.model.Results results = (org.jenkinsci.plugins.cppcheck.model.Results) unmarshaller.unmarshal(file);
                        if (results.getCppcheck() == null) {
                            throw new JAXBException("Test with versio 1");
                        }
                        report = getReportVersion2(results);
                    } catch (JAXBException jxe) {
                        try {
                            jc.set(JAXBContext.newInstance(com.thalesgroup.jenkinsci.plugins.cppcheck.model.Error.class, com.thalesgroup.jenkinsci.plugins.cppcheck.model.Results.class));
                            Unmarshaller unmarshaller = jc.get().createUnmarshaller();
                            com.thalesgroup.jenkinsci.plugins.cppcheck.model.Results results = (com.thalesgroup.jenkinsci.plugins.cppcheck.model.Results) unmarshaller.unmarshal(file);
                            report = getReportVersion1(results);
                        } catch (JAXBException jxe1) {
                            throw new IOException(jxe1);   // <<<<<<<<<<<<<<<<<<<<< CppcheckParser.java:56
                        }
                    }
            

            https://java.net/projects/hudson/lists/users/archive/2007-09/message/479
            http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html#IOException(java.lang.Throwable)

            Show
            mixalturek Michal Turek added a comment - - edited The same issue is present in JENKINS-11354 and in JENKINS-1087 . It is caused by using constructor IOException(Throwable cause) introduced in Java 1.6 (compile time) in Java 1.5 (run time). try { jc.set(JAXBContext.newInstance( org.jenkinsci.plugins.cppcheck.model.Error.class, org.jenkinsci.plugins.cppcheck.model.Errors.class, org.jenkinsci.plugins.cppcheck.model.Cppcheck.class, org.jenkinsci.plugins.cppcheck.model.Results.class)); Unmarshaller unmarshaller = jc.get().createUnmarshaller(); org.jenkinsci.plugins.cppcheck.model.Results results = (org.jenkinsci.plugins.cppcheck.model.Results) unmarshaller.unmarshal(file); if (results.getCppcheck() == null) { throw new JAXBException("Test with versio 1"); } report = getReportVersion2(results); } catch (JAXBException jxe) { try { jc.set(JAXBContext.newInstance(com.thalesgroup.jenkinsci.plugins.cppcheck.model.Error.class, com.thalesgroup.jenkinsci.plugins.cppcheck.model.Results.class)); Unmarshaller unmarshaller = jc.get().createUnmarshaller(); com.thalesgroup.jenkinsci.plugins.cppcheck.model.Results results = (com.thalesgroup.jenkinsci.plugins.cppcheck.model.Results) unmarshaller.unmarshal(file); report = getReportVersion1(results); } catch (JAXBException jxe1) { throw new IOException(jxe1); // <<<<<<<<<<<<<<<<<<<<< CppcheckParser.java:56 } } https://java.net/projects/hudson/lists/users/archive/2007-09/message/479 http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html#IOException(java.lang.Throwable )
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Michal Turek
            Path:
            src/main/java/org/jenkinsci/plugins/cppcheck/parser/CppcheckParser.java
            http://jenkins-ci.org/commit/cppcheck-plugin/ea782dca4dc0444996f4260839e1c2603d66e9d0
            Log:
            JENKINS-11354 CppCheck plugin cannot find CppCheck report
            JENKINS-22823 Cppcheck plugin can't connect to report file

            • Constructor IOException(Throwable cause) was introduced in Java 1.6 and is not compatible with Java 1.5.

            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:56)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michal Turek Path: src/main/java/org/jenkinsci/plugins/cppcheck/parser/CppcheckParser.java http://jenkins-ci.org/commit/cppcheck-plugin/ea782dca4dc0444996f4260839e1c2603d66e9d0 Log: JENKINS-11354 CppCheck plugin cannot find CppCheck report JENKINS-22823 Cppcheck plugin can't connect to report file Constructor IOException(Throwable cause) was introduced in Java 1.6 and is not compatible with Java 1.5. 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:56)
            Hide
            mixalturek Michal Turek added a comment -

            Angelo, I have attached cppcheck.hpi (use the newer one), which is plugin version 1.16 with the fix for Java 1.5. Please try it to see why the parsing fails, we can then continue with the investigation.

            By the way, is there any reason for not using --xml-version=2 argument? Cppcheck reports more issues with the newer format (unknown why for me), so it should be preferred. Also Java 1.5 is pretty old - ten years, Java 8 was released a month ago

            Show
            mixalturek Michal Turek added a comment - Angelo, I have attached cppcheck.hpi (use the newer one), which is plugin version 1.16 with the fix for Java 1.5. Please try it to see why the parsing fails, we can then continue with the investigation. By the way, is there any reason for not using --xml-version=2 argument? Cppcheck reports more issues with the newer format (unknown why for me), so it should be preferred. Also Java 1.5 is pretty old - ten years, Java 8 was released a month ago
            Hide
            acordinz Angelo Cordova added a comment -

            Thanks for all your help.

            Michal, I do use --xml-version=2 argument, but I didn't provide any evidence of that, just the error message.

            Anyway, I had to upgrade java version, because cppcheck was not the only one plugin that was failing, Now I'm using Java 6 and everything seems perfect (I was forced to use Java 5, not my decision).

            Thanks again

            Show
            acordinz Angelo Cordova added a comment - Thanks for all your help. Michal, I do use --xml-version=2 argument, but I didn't provide any evidence of that, just the error message. Anyway, I had to upgrade java version, because cppcheck was not the only one plugin that was failing, Now I'm using Java 6 and everything seems perfect (I was forced to use Java 5, not my decision). Thanks again
            Hide
            mixalturek Michal Turek added a comment -

            The code was in block for --xml-version=1, but an unexpected JAXBException might occur because of Java 1.5, I don't know. I was forced to install and maintain a very old version of RedHat some time ago so I fully understand you with this. I will close the issue now, please reopen it if you need additional help.

            Show
            mixalturek Michal Turek added a comment - The code was in block for --xml-version=1, but an unexpected JAXBException might occur because of Java 1.5, I don't know. I was forced to install and maintain a very old version of RedHat some time ago so I fully understand you with this. I will close the issue now, please reopen it if you need additional help.

              People

              • Assignee:
                mixalturek Michal Turek
                Reporter:
                acordinz Angelo Cordova
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: