Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-3229

PMD fails when inspecting Java files suffixed with .jav

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: None
    • Labels:
      None

      Description

      The problem is that files suffixed with .jav are available in API but are not indexed by Squid/source importer. It raises the error :

      [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project RioImport: Can not execute Sonar: java.lang.IllegalStateException: Current event not START_ELEMENT -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project RioImport: Can not execute Sonar
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
      	at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
      	at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
      	at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      	... 19 more
      Caused by: org.sonar.api.utils.XmlParserException: java.lang.IllegalStateException: Current event not START_ELEMENT
      	at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:54)
      	at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:59)
      	at org.sonar.batch.phases.Phases.execute(Phases.java:75)
      	at org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:55)
      	at org.sonar.batch.Batch.analyzeModule(Batch.java:158)
      	at org.sonar.batch.Batch.analyzeModules(Batch.java:76)
      	at org.sonar.batch.Batch.execute(Batch.java:62)
      	at org.sonar.maven3.SonarMojo.executeBatch(SonarMojo.java:144)
      	at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:135)
      	at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113)
      	... 23 more
      Caused by: java.lang.IllegalStateException: Current event not START_ELEMENT
      	at com.ctc.wstx.sr.BasicStreamReader.getAttributeValue(BasicStreamReader.java:621)
      	at org.codehaus.staxmate.in.SMInputCursor.getAttrValue(SMInputCursor.java:984)
      	at org.sonar.plugins.pmd.PmdViolationsXmlParser$StreamHandler.stream(PmdViolationsXmlParser.java:62)
      	at org.sonar.api.utils.StaxParser.parse(StaxParser.java:110)
      	at org.sonar.api.utils.StaxParser.parse(StaxParser.java:90)
      	at org.sonar.api.utils.StaxParser.parse(StaxParser.java:80)
      	at org.sonar.plugins.pmd.PmdViolationsXmlParser.parse(PmdViolationsXmlParser.java:53)
      	at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:50)
      	... 32 more
      

      Note that the exception message should provide the related filename.

        Attachments

          Activity

            People

            Assignee:
            simon.brandhof Simon Brandhof (Inactive)
            Reporter:
            simon.brandhof Simon Brandhof (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: