SonarQube - sonar-pmd-pluginのアップグレード(2.2->2.3)でエラー

  • 0
    Like
  • 0
    Comment
    More than 1 year has passed since last update.

    SonarQubeにてPMDプラグインのバージョンを2.2から2.3に上げたところ、既存のプロジェクトをSonarRunnerを通してSonarQubeに解析をさせようとしたところ、以下のエラーに遭遇した。

    詳細は調べていないが、PMDプラグインを2.3から2.2に戻したところエラーは発生しなくなった。

    なお、同時にSonarQube自身も4.5.1から5.0へアップグレードしているが、PMDプラグインを戻すことによってエラーが発生しなくなったことから、SonarQube自身のVersionは関係ない可能性が高いと思っている。

    INFO: ------------------------------------------------------------------------
    INFO: EXECUTION FAILURE
    INFO: ------------------------------------------------------------------------
    Total time: 2:02.216s
    Final Memory: 32M/870M
    INFO: ------------------------------------------------------------------------
    ERROR: Error during Sonar runner execution
    org.sonar.runner.impl.RunnerException: Unable to execute Sonar
            at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
            at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
            at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
            at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
            at org.sonar.runner.api.Runner.execute(Runner.java:100)
            at org.sonar.runner.Main.executeTask(Main.java:70)
            at org.sonar.runner.Main.execute(Main.java:59)
            at org.sonar.runner.Main.main(Main.java:53)
    Caused by: java.lang.NoClassDefFoundError: my/imported/lib/AbstractClass
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
            at net.sourceforge.pmd.lang.java.typeresolution.PMDASMClassLoader.loadClass(PMDASMClassLoader.java:62)
            at net.sourceforge.pmd.lang.java.symboltable.TypeSet$ExplicitImportResolver.resolve(TypeSet.java:93)
            at net.sourceforge.pmd.lang.java.symboltable.TypeSet.findClass(TypeSet.java:265)
            at net.sourceforge.pmd.lang.java.symboltable.SourceFileScope.resolveType(SourceFileScope.java:55)
            at net.sourceforge.pmd.lang.java.symboltable.ClassScope.determineParameterTypes(ClassScope.java:217)
            at net.sourceforge.pmd.lang.java.symboltable.ClassScope.findVariableHere(ClassScope.java:142)
            at net.sourceforge.pmd.lang.java.symboltable.AbstractJavaScope.contains(AbstractJavaScope.java:33)
            at net.sourceforge.pmd.lang.java.symboltable.Search.searchUpward(Search.java:45)
            at net.sourceforge.pmd.lang.java.symboltable.Search.searchUpward(Search.java:49)
            at net.sourceforge.pmd.lang.java.symboltable.Search.searchUpward(Search.java:49)
            at net.sourceforge.pmd.lang.java.symboltable.Search.searchUpward(Search.java:49)
            at net.sourceforge.pmd.lang.java.symboltable.Search.searchUpward(Search.java:49)
            at net.sourceforge.pmd.lang.java.symboltable.Search.execute(Search.java:24)
            at net.sourceforge.pmd.lang.java.symboltable.OccurrenceFinder.visit(OccurrenceFinder.java:26)
            at net.sourceforge.pmd.lang.java.ast.ASTPrimaryExpression.jjtAccept(ASTPrimaryExpression.java:22)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:228)
            at net.sourceforge.pmd.lang.java.ast.ASTExpression.jjtAccept(ASTExpression.java:22)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:372)
            at net.sourceforge.pmd.lang.java.ast.ASTStatementExpression.jjtAccept(ASTStatementExpression.java:22)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:348)
            at net.sourceforge.pmd.lang.java.ast.ASTStatement.jjtAccept(ASTStatement.java:22)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:360)
            at net.sourceforge.pmd.lang.java.ast.ASTBlockStatement.jjtAccept(ASTBlockStatement.java:22)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:356)
            at net.sourceforge.pmd.lang.java.ast.ASTBlock.jjtAccept(ASTBlock.java:22)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:432)
            at net.sourceforge.pmd.lang.java.ast.ASTTryStatement.jjtAccept(ASTTryStatement.java:23)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:348)
            at net.sourceforge.pmd.lang.java.ast.ASTStatement.jjtAccept(ASTStatement.java:22)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:360)
            at net.sourceforge.pmd.lang.java.ast.ASTBlockStatement.jjtAccept(ASTBlockStatement.java:22)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:356)
            at net.sourceforge.pmd.lang.java.ast.ASTBlock.jjtAccept(ASTBlock.java:22)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:180)
            at net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration.jjtAccept(ASTMethodDeclaration.java:25)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:45)
            at net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceBodyDeclaration.jjtAccept(ASTClassOrInterfaceBodyDeclaration.java:41)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:41)
            at net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceBody.jjtAccept(ASTClassOrInterfaceBody.java:22)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:17)
            at net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration.jjtAccept(ASTClassOrInterfaceDeclaration.java:26)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:156)
            at net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration.jjtAccept(ASTTypeDeclaration.java:36)
            at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:55)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:9)
            at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:136)
            at net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit.jjtAccept(ASTCompilationUnit.java:42)
            at net.sourceforge.pmd.lang.java.symboltable.SymbolFacade.initializeWith(SymbolFacade.java:16)
            at net.sourceforge.pmd.lang.java.AbstractJavaHandler$4.start(AbstractJavaHandler.java:79)
            at net.sourceforge.pmd.SourceCodeProcessor.symbolFacade(SourceCodeProcessor.java:100)
            at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:139)
            at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:76)
            at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:43)
            at org.sonar.plugins.pmd.PmdTemplate.process(PmdTemplate.java:83)
            at org.sonar.plugins.pmd.PmdExecutor.executeRules(PmdExecutor.java:119)
            at org.sonar.plugins.pmd.PmdExecutor.executePmd(PmdExecutor.java:89)
            at org.sonar.plugins.pmd.PmdExecutor.execute(PmdExecutor.java:75)
            at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:67)
            at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
            at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
            at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:122)
            at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:222)
            at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
            at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
            at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
            at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
            at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
            at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:223)
            at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
            at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
            at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
            at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:52)
            at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:128)
            at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
            at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
            at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:171)
            at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
            at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
            at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
            ... 9 more
    Caused by: java.lang.ClassNotFoundException: my.imported.lib.AbstractClass
            at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
            ... 133 more