Skip to content
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

Open
alok347 opened this issue Apr 29, 2022 · 5 comments

Comments

@alok347
Copy link

alok347 commented Apr 29, 2022

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).

@alok347
Copy link
Author

alok347 commented May 4, 2022

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,
Alok Singh

@jborgers
Copy link
Owner

Hi, It should work in Sonar 8.9/9.4 with sonar-pmd plugin 3.4.0. Can you try?

@alok347
Copy link
Author

alok347 commented May 30, 2022

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
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:06 May 30, 2022 12:30:06 AM net.sourceforge.pmd.RuleSetFactory parseRuleSetNode
00:30:06 WARNING: RuleSet description is missing. Future versions of PMD will require it.
00:30:07 May 30, 2022 12:30:07 AM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver getFieldType
00:30:07 WARNING: Error during type resolution due to: java.lang.NoClassDefFoundError: javax/tools/JavaFileObject
00:30:07 May 30, 2022 12:30:07 AM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver getFieldType
00:30:07 WARNING: Error during type resolution due to: java.lang.NoClassDefFoundError: javax/tools/JavaFileObject
00:30:07 May 30, 2022 12:30:07 AM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver getFieldType
00:30:07 WARNING: Error during type resolution due to: java.lang.NoClassDefFoundError: javax/tools/JavaFileObject
00:30:07 [INFO] Execute PMD 6.10.0 (done) | time=1024ms
00:30:07 [INFO] ------------------------------------------------------------------------
00:30:07 [INFO] Reactor Summary:
00:30:07 [INFO]
00:30:07 [INFO]Client - feedback 1.0-SNAPSHOT FAILURE [ 48.325 s]
00:30:07 [INFO] abc-interface ................... SKIPPED
00:30:07 [INFO] zz zzz tttt ......................... SKIPPED
00:30:07 [INFO] abc-implementation .............. SKIPPED
00:30:07 [INFO] abc-core ........................ SKIPPED
00:30:07 [INFO] abc-k8s ......................... SKIPPED
00:30:07 [INFO] abc-installation ................ SKIPPED
00:30:07 [INFO] k8s-abc 1.0-SNAPSHOT ............ SKIPPED
00:30:07 [INFO] ------------------------------------------------------------------------
00:30:07 [INFO] BUILD FAILURE
00:30:07 [INFO] ------------------------------------------------------------------------
00:30:07 [INFO] Total time: 49.308 s
00:30:07 [INFO] Finished at: 2022-05-30T00:30:07+05:30
00:30:07 [INFO] ------------------------------------------------------------------------
00:30:07 [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project abc: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar: javax/tools/JavaFileObject
00:30:07 [ERROR] -----------------------------------------------------
00:30:07 [ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:3.4.0.905
00:30:07 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
00:30:07 [ERROR] urls[0] = file:/root/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.4.0.905/sonar-maven-plugin-3.4.0.905.jar
00:30:07 [ERROR] urls[1] = file:/root/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
00:30:07 [ERROR] urls[2] = file:/root/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
00:30:07 [ERROR] urls[3] = file:/root/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
00:30:07 [ERROR] urls[4] = file:/root/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.10.0.1189/sonar-scanner-api-2.10.0.1189.jar
00:30:07 [ERROR] urls[5] = file:/root/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
00:30:07 [ERROR] Number of foreign imports: 1
00:30:07 [ERROR] import: Entry[import from realm ClassRealm[project>com.abc:abc:1.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
00:30:07 [ERROR]
00:30:07 [ERROR] -----------------------------------------------------
00:30:07 [ERROR] : javax.tools.JavaFileObject
00:30:07 [ERROR] -> [Help 1]
00:30:07 [ERROR]
00:30:07 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
00:30:07 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
00:30:07 [ERROR]
00:30:07 [ERROR] For more information about the errors and possible solutions, please read the following articles:
00:30:07 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

Currently we are observing the error:

java.lang.NoClassDefFoundError: javax/tools/JavaFileObject

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

@stokpop
Copy link
Collaborator

stokpop commented May 31, 2022

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?

@alok347
Copy link
Author

alok347 commented Jul 15, 2022

Hi @stokpop @jborgers ,

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/

  • mvn verify ...
  • export JAVA_HOME=/path/to/java11
  • mvn sonar:sonar ...

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
SonarQube Version 7.9.4
Maven build and compile : Java 8
SonarQube analysis : java 11

We aren't planning the plugin upgrade currently , as it might impact other users project issues measures.

  • Awaiting a solution from you as we are blocked and sonarqube doesn't support issues related to 3rd party plugins.

Regards,
Alok Singh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants