-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR: Fail to execute PMD. Following file is ignored - NullPointerException #304
Comments
Hi @ehartmann / @Godin/ @dgageot / @simonbrandhof , Did you get a chance to review my issue? Please let me know if any addition info is required from my side. Regards, |
Hi, It should work in Sonar 8.9/9.4 with sonar-pmd plugin 3.4.0. Can you try? |
Hi @jborgers , Thank you for responding to my issue. Unfortunately, we can't upgrade to 8.9/9.x currently and its in our pipeline. Please see the below error that we are observing now: 00:30:06 [INFO] PMD configuration: //pmd.xml Currently we are observing the error:
Just want to understand from you what might be the cause of this error and how can we fix it in SonarQube 7.9.4 version. ~Alok Singh |
Hi Alok, the javax.tools.JavaFileObject seems missing from the runtime classpath. Please check: is it maybe due to the java version/installation that you are using? Maybe a jre instead of a jdk without tools.jar present. Or a custom java setup without the java.compile module? |
Apologies for the delayed response. The user did test the java installation path and looks like java 11 does not have tools.jar file. Let me also put more details on the current setup: Recently we asked the users to upgrade to java 11 as sonarsource recommends using java 11 on the client side. The project which were not able to upgrade to java -11, as they had dependancy on java -8 for build and compilation, we suggested them a workaround of using java 11, only during sonarqube analysis. Below is the workaround steps: https://docs.sonarqube.org/8.9/analysis/analysis-with-java-11/
The above workaround is well accepted and worked fine with all the legacy projects except this one. The analysis fails at the pmd plugin execution for one the module X complaining about the javax.tools.JavaFileObject . This project is a multi module project running using a jenkins with common configuration. PMD Plugin Version : 3.2.1 We aren't planning the plugin upgrade currently , as it might impact other users project issues measures.
Regards, |
12:23:58 [INFO] Sensor PmdSensor [pmdextensions]
12:23:58 [INFO] Execute PMD 6.10.0
12:23:58 [INFO] Java version: 1.8
12:23:58 [INFO] PMD configuration: /pmd.xml
12:23:58 Apr 26, 2022 12:23:57 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:57 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:57 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:57 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:57 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:57 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:57 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:57 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:57 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:57 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:58 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:58 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:58 Apr 26, 2022 12:23:58 PM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
12:23:58 WARNING: RuleSet description is missing. Future versions of PMD will require it.
12:23:59 [ERROR] Fail to execute PMD. Following file is ignored: xxx.java
12:23:59 net.sourceforge.pmd.PMDException: Error while processing file:///xxx.java
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:102)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:51)
12:23:59 at org.sonar.plugins.pmd.PmdTemplate.process(PmdTemplate.java:101)
12:23:59 at org.sonar.plugins.pmd.PmdExecutor.executeRules(PmdExecutor.java:131)
12:23:59 at org.sonar.plugins.pmd.PmdExecutor.executePmd(PmdExecutor.java:98)
12:23:59 at org.sonar.plugins.pmd.PmdExecutor.execute(PmdExecutor.java:80)
12:23:59 at org.sonar.plugins.pmd.PmdSensor.execute(PmdSensor.java:71)
12:23:59 at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
12:23:59 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
12:23:59 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
12:23:59 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:392)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:392)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
12:23:59 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
12:23:59 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
12:23:59 at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
12:23:59 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
12:23:59 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
12:23:59 at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
12:23:59 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
12:23:59 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:23:59 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:23:59 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
12:23:59 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
12:23:59 at com.sun.proxy.$Proxy24.execute(Unknown Source)
12:23:59 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
12:23:59 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
12:23:59 at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:63)
12:23:59 at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:108)
12:23:59 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
12:23:59 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
12:23:59 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
12:23:59 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
12:23:59 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
12:23:59 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
12:23:59 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
12:23:59 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
12:23:59 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
12:23:59 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
12:23:59 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
12:23:59 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954)
12:23:59 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
12:23:59 at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:23:59 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:23:59 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
12:23:59 Caused by: java.lang.NullPointerException: null
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.populateType(ClassTypeResolver.java:1361)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.populateType(ClassTypeResolver.java:1293)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:229)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTImportDeclaration.jjtAccept(ASTImportDeclaration.java:135)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:181)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:213)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit.jjtAccept(ASTCompilationUnit.java:41)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.TypeResolutionFacade.initializeWith(TypeResolutionFacade.java:18)
12:23:59 at net.sourceforge.pmd.lang.java.AbstractJavaHandler$5.start(AbstractJavaHandler.java:109)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.usesTypeResolution(SourceCodeProcessor.java:153)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:180)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:96)
12:23:59 ... 59 common frames omitted
12:23:59
12:23:59 Apr 26, 2022 12:23:59 PM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver getFieldType
12:23:59 WARNING: Error during type resolution due to: java.lang.NoClassDefFoundError: javax/tools/JavaFileObject
12:23:59 Apr 26, 2022 12:23:59 PM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver getFieldType
12:23:59 WARNING: Error during type resolution due to: java.lang.NoClassDefFoundError: javax/tools/JavaFileObject
12:23:59 Apr 26, 2022 12:23:59 PM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver getFieldType
12:23:59 WARNING: Error during type resolution due to: java.lang.NoClassDefFoundError: javax/tools/JavaFileObject
12:23:59 [ERROR] Fail to execute PMD. Following file is ignored: ixxx.java
12:23:59 net.sourceforge.pmd.PMDException: Error while processing file:///xxx/xxx/xxx/xxx/xxx
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:102)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:51)
12:23:59 at org.sonar.plugins.pmd.PmdTemplate.process(PmdTemplate.java:101)
12:23:59 at org.sonar.plugins.pmd.PmdExecutor.executeRules(PmdExecutor.java:131)
12:23:59 at org.sonar.plugins.pmd.PmdExecutor.executePmd(PmdExecutor.java:98)
12:23:59 at org.sonar.plugins.pmd.PmdExecutor.execute(PmdExecutor.java:80)
12:23:59 at org.sonar.plugins.pmd.PmdSensor.execute(PmdSensor.java:71)
12:23:59 at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
12:23:59 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
12:23:59 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
12:23:59 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:392)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:392)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
12:23:59 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
12:23:59 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
12:23:59 at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
12:23:59 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
12:23:59 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
12:23:59 at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
12:23:59 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
12:23:59 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:23:59 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:23:59 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
12:23:59 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
12:23:59 at com.sun.proxy.$Proxy24.execute(Unknown Source)
12:23:59 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
12:23:59 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
12:23:59 at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:63)
12:23:59 at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:108)
12:23:59 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
12:23:59 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
12:23:59 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
12:23:59 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
12:23:59 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
12:23:59 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
12:23:59 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
12:23:59 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
12:23:59 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
12:23:59 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
12:23:59 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
12:23:59 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954)
12:23:59 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
12:23:59 at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:23:59 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:23:59 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
12:23:59 Caused by: java.lang.NullPointerException: null
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.populateType(ClassTypeResolver.java:1361)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:262)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceType.jjtAccept(ASTClassOrInterfaceType.java:32)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:436)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:1156)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTAllocationExpression.jjtAccept(ASTAllocationExpression.java:28)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:401)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:1035)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTPrimaryPrefix.jjtAccept(ASTPrimaryPrefix.java:42)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:869)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTPrimaryExpression.jjtAccept(ASTPrimaryExpression.java:22)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:296)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:729)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTExpression.jjtAccept(ASTExpression.java:34)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:536)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTReturnStatement.jjtAccept(ASTReturnStatement.java:22)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:446)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTStatement.jjtAccept(ASTStatement.java:22)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:461)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTBlockStatement.jjtAccept(ASTBlockStatement.java:22)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:456)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTBlock.jjtAccept(ASTBlock.java:25)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:236)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration.jjtAccept(ASTMethodDeclaration.java:33)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:56)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceBodyDeclaration.jjtAccept(ASTClassOrInterfaceBodyDeclaration.java:43)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:51)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceBody.jjtAccept(ASTClassOrInterfaceBody.java:32)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:21)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration.jjtAccept(ASTClassOrInterfaceDeclaration.java:55)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:206)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:242)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration.jjtAccept(ASTTypeDeclaration.java:37)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:181)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:213)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit.jjtAccept(ASTCompilationUnit.java:41)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.TypeResolutionFacade.initializeWith(TypeResolutionFacade.java:18)
12:23:59 at net.sourceforge.pmd.lang.java.AbstractJavaHandler$5.start(AbstractJavaHandler.java:109)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.usesTypeResolution(SourceCodeProcessor.java:153)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:180)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:96)
12:23:59 ... 59 common frames omitted
12:23:59
12:23:59 [ERROR] Fail to execute PMD. Following file is ignored: xxxx/xxxx/xxxx/xxxx.java
12:23:59 net.sourceforge.pmd.PMDException: Error while processing file:///xxxxxxx
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:102)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:51)
12:23:59 at org.sonar.plugins.pmd.PmdTemplate.process(PmdTemplate.java:101)
12:23:59 at org.sonar.plugins.pmd.PmdExecutor.executeRules(PmdExecutor.java:131)
12:23:59 at org.sonar.plugins.pmd.PmdExecutor.executePmd(PmdExecutor.java:98)
12:23:59 at org.sonar.plugins.pmd.PmdExecutor.execute(PmdExecutor.java:80)
12:23:59 at org.sonar.plugins.pmd.PmdSensor.execute(PmdSensor.java:71)
12:23:59 at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
12:23:59 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
12:23:59 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
12:23:59 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
12:23:59 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:392)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:392)
12:23:59 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
12:23:59 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
12:23:59 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
12:23:59 at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
12:23:59 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
12:23:59 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
12:23:59 at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
12:23:59 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
12:23:59 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:23:59 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:23:59 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
12:23:59 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
12:23:59 at com.sun.proxy.$Proxy24.execute(Unknown Source)
12:23:59 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
12:23:59 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
12:23:59 at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:63)
12:23:59 at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:108)
12:23:59 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
12:23:59 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
12:23:59 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
12:23:59 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
12:23:59 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
12:23:59 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
12:23:59 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
12:23:59 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
12:23:59 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
12:23:59 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
12:23:59 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
12:23:59 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954)
12:23:59 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
12:23:59 at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:23:59 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:23:59 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:23:59 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
12:23:59 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
12:23:59 Caused by: java.lang.NullPointerException: null
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.populateType(ClassTypeResolver.java:1361)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.populateType(ClassTypeResolver.java:1293)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:229)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTImportDeclaration.jjtAccept(ASTImportDeclaration.java:135)
12:23:59 at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept(AbstractJavaNode.java:60)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:11)
12:23:59 at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit(JavaParserVisitorAdapter.java:181)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.visit(ClassTypeResolver.java:213)
12:23:59 at net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit.jjtAccept(ASTCompilationUnit.java:41)
12:23:59 at net.sourceforge.pmd.lang.java.typeresolution.TypeResolutionFacade.initializeWith(TypeResolutionFacade.java:18)
12:23:59 at net.sourceforge.pmd.lang.java.AbstractJavaHandler$5.start(AbstractJavaHandler.java:109)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.usesTypeResolution(SourceCodeProcessor.java:153)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:180)
12:23:59 at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:96)
12:23:59 ... 59 common frames omitted
12:23:59
12:23:59 [INFO] Execute PMD 6.10.0 (done) | time=1580ms
We are using the PMD plugin with sonarqube 7.9.4 version and the above analysis of the project fails with the javanullexception.
Any idea of what might cause this issue and how to fix it ?
Does anybody already had this kind of behavior with PMD plugin ?
We are using Java 8 and the associated pmd sonarqube property is well set (sonar.java.source=1.8).
The text was updated successfully, but these errors were encountered: