Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-111

More information on issue: "Got an exception - java.lang.RuntimeException: Unable to get class information for [exception]"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Not A Problem
    • 2.2
    • None
    • None
    • None
    • Windows Vista Business (x64), Windows XP (x86), Windows 2003 Server (x86)
      Apache Maven 2.1.0 (r755702; 2009-03-18 20:10:27+0100) and Maven 2.0.10
      Java version: 1.6.0_13

    Description

      This bug report provides more insight on the situations in which the maven-checkstyle-plugin is unable to get the class information for exceptions that are declared by the project. This report is, therefore, a refinement of prior bug reports such as MPCHECKSTYLE-1, MPCHECKSTYLE-20, or MCHECKSTYLE-54. We believe, however, that through a more in-depth study of the problem we can provide a narrower definition of the problem that, hopefully, will result in it resolution.

      Our experiments have shown that the maven-checkstyle-plugin fails for classes or interfaces that contain method signatures with a "throws" clause pointing to exception defined by both the project and elsewhere. This is demonstrated by the interface "ch.ethz.globis.demo.Demo" contained in the attached demo project.
      {{
      public interface Demo

      { void foo() throws DemoException, IOException, FileNotFoundException; void foofoo() throws DemoException; void bar() throws IOException, FileNotFoundException, IllegalArgumentException; }

      }}
      If the command "mvn checkstyle:check" is executed in the project, it will fail with one checkstyle violation. If, however, the method "foo()" is commented (or removed), everything works fine. Note that method "foofoo()" which only declares "ch.ethz.globis.demo.DemoException" is unproblematic as well as method "bar()" which declares a set of exceptions that are declared outside the project. Hence, the conclusion is that it is the combination of both project and outside-project exceptions that make the maven-checkstyle-plugin fail. Note that we have run maven on clean installation (where the local repository has been removed first) to produce a reproducible error.

      The attached zip file contains both the demo project that can be used to reproduce the error as well as the output of the "mvn checkstyle:check" command under "target". We also provide the file "output.txt" that documents the console output of the command. If further documentation is required, do not hesitate to contact me. We hope that by providing this information we can contribute to the resolution of said issue, once and for all.

      Attachments

        1. output.txt
          5 kB
          Michael Grossniklaus
        2. maven-checkstyle-plugin.zip
          69 kB
          Michael Grossniklaus

        Issue Links

          Activity

            People

              struberg Mark Struberg
              zaskar Michael Grossniklaus
              Votes:
              6 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: