I have a JAVA project and we use Atlassian SDK to compile the code and now we would like to scan this projects but we are getting below error and i assume that error is because its use OPEN JDK on the server. I would like to know how we can use AtlassinSDK for getting successful scan.
When i tried to scan using sonar scanner we are getting below error.
0:50:56.782 DEBUG: * SonarPHP 2.14.0.3569 (php)
00:50:56.782 DEBUG: * SonarTS 1.8.0.3332 (typescript)
00:50:56.782 DEBUG: * SonarVB 7.7.0.7192 (vbnet)
00:50:56.802 INFO: Loaded core extensions:
00:50:57.491 INFO: Process project properties
00:50:57.590 INFO: ------------------------------------------------------------------------
00:50:57.590 INFO: EXECUTION FAILURE
00:50:57.590 INFO: ------------------------------------------------------------------------
00:50:57.591 INFO: Total time: 3.345s
00:50:57.618 INFO: Final Memory: 6M/40M
00:50:57.619 INFO: ------------------------------------------------------------------------
00:50:57.619 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectLock
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:281)
at org.sonar.scanner.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:121)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)
at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.DefaultInputModuleHierarchy
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 24 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.api.batch.bootstrap.ProjectReactor
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.SingleMemberInjector.getMemberArguments(SingleMemberInjector.java:61)
at org.picocontainer.injectors.MethodInjector.getMemberArguments(MethodInjector.java:100)
at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:112)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 38 more
7.4 is way past EOL. You should upgrade immediately. Your upgrade path is:
7.9 â 7.9.4 â 8.5 (this step optional)
Once youâve upgraded and re-tried your analysis, come back to us if the problem persists. Java analysis has been completely re-written since 7.4. I canât promise it, but your problem is likely to evaporate after upgrade.
I donât suspect this error has any thing to do with the fact you are using the Atlassian SDK, it is only a simple wrapper for Maven and some commands specific to Atlassian P2 App development.
I would suspect that there is an issue with the Sonar cache preventing the correct execution of the analysis.
There should be an .sonar directory within your Maven Repository that holds this cache.
@Palugula_Sunil can you try deleting this directory and execute a new verbose analysis (by adding -X to the Maven command) and share the full build log if this doesnât resolve the issue.
I am not sure if we can use the existing thread but still posting my issue.
I am scanning new project which also uses the AtlassainSDK maven and we are using below command for scanning but scan is getting failed with below error. Can you please help me in fixing the issue.
I have changed the XMX values but still its getting failed, when we just compile without sonar:sonar build is getting compiled successfully without any issues that with lesser XMX value.
But wow do you really need 8 gigs of memory just to build the app? Could it be that either you main or test code. contains a memory leak?
I have had cases in the past where increasing the memory limits only made the problem worse.You could try running the build with no -Xmx, -Xms and -XX:... settings and see if the build fails with a ânormalâ out of memory exception. Your exception is about garbage collection taking too much time with very little results.
If this build keeps failing, then try to increase the -Xmx and -Xms settings but keep then the same. This lightens the âloadâ on the JVM to keep asking for more memory from the OS.
If you are back at the 8gig memory setting, then try tuning the garbage collector by enabling the concurrent low pause collector -XX:+UseConcMarkSweepGC.
If all else fail, then you could also try enabling -XX:-UseGCOverheadLimit. This option will disable the check that throws your original out of memory exception, but keep in mind that this can have a big impact on your machine running the build!!
Basically at the first attempt i tried the build with any of the below values once build started failing then i used below parameters by increasing 1 GB for each try and when i reached 8GB i thought that there is some other issue and out of memory is misleading me and i have updated here about the issue.
As said the regular build is getting compiled with 2GB but when coming to scan its failing with 8GB, I have also tried the build with -XX:+UseConcMarkSweepGC & -XX:-UseGCOverheadLimit but still see the below issue.
Note sure how to verify if these are parameters are passed to build from command line
build 06-Nov-2020 03:00:06 [INFO] ------------------------------------------------------------------------
build 06-Nov-2020 03:00:06 [INFO] BUILD FAILURE
build 06-Nov-2020 03:00:06 [INFO] ------------------------------------------------------------------------
build 06-Nov-2020 03:00:06 [INFO] Total time: 02:43 min
build 06-Nov-2020 03:00:06 [INFO] Finished at: 2020-11-06T03:00:06-05:00
build 06-Nov-2020 03:00:07 [INFO] Final Memory: 62M/603M
build 06-Nov-2020 03:00:07 [INFO] ------------------------------------------------------------------------
build 06-Nov-2020 03:00:07 [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project hoursTracking: Can not execute Findbugs: java.lang.OutOfMemoryError: GC overhead limit exceeded -> [Help 1]
build 06-Nov-2020 03:00:07 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project hoursTracking: Can not execute Findbugs
build 06-Nov-2020 03:00:07 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
build 06-Nov-2020 03:00:07 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
build 06-Nov-2020 03:00:07 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
build 06-Nov-2020 03:00:07 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
build 06-Nov-2020 03:00:07 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
build 06-Nov-2020 03:00:07 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
build 06-Nov-2020 03:00:07 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
build 06-Nov-2020 03:00:07 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
build 06-Nov-2020 03:00:07 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
build 06-Nov-2020 03:00:07 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
build 06-Nov-2020 03:00:07 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
build 06-Nov-2020 03:00:07 at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
build 06-Nov-2020 03:00:07 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
build 06-Nov-2020 03:00:07 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
build 06-Nov-2020 03:00:07 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
build 06-Nov-2020 03:00:07 at java.lang.reflect.Method.invoke(Method.java:498)
build 06-Nov-2020 03:00:07 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
build 06-Nov-2020 03:00:07 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
build 06-Nov-2020 03:00:07 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
build 06-Nov-2020 03:00:07 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
build 06-Nov-2020 03:00:07 Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Findbugs
build 06-Nov-2020 03:00:07 at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:67)
build 06-Nov-2020 03:00:07 at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:104)
build 06-Nov-2020 03:00:07 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
build 06-Nov-2020 03:00:07 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
build 06-Nov-2020 03:00:07 ⌠19 more
build 06-Nov-2020 03:00:07 Caused by: java.lang.IllegalStateException: Can not execute Findbugs
build 06-Nov-2020 03:00:07 at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:188)
build 06-Nov-2020 03:00:07 at org.sonar.plugins.findbugs.FindbugsSensor.execute(FindbugsSensor.java:119)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:45)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:62)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:74)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:164)
build 06-Nov-2020 03:00:07 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
build 06-Nov-2020 03:00:07 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:319)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:314)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:288)
build 06-Nov-2020 03:00:07 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
build 06-Nov-2020 03:00:07 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)
build 06-Nov-2020 03:00:07 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
build 06-Nov-2020 03:00:07 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
build 06-Nov-2020 03:00:07 at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)
build 06-Nov-2020 03:00:07 at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
build 06-Nov-2020 03:00:07 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
build 06-Nov-2020 03:00:07 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
build 06-Nov-2020 03:00:07 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
build 06-Nov-2020 03:00:07 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
build 06-Nov-2020 03:00:07 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
build 06-Nov-2020 03:00:07 at java.lang.reflect.Method.invoke(Method.java:498)
build 06-Nov-2020 03:00:07 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
build 06-Nov-2020 03:00:07 at com.sun.proxy.$Proxy24.execute(Unknown Source)
build 06-Nov-2020 03:00:07 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
build 06-Nov-2020 03:00:07 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
build 06-Nov-2020 03:00:07 at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:65)
build 06-Nov-2020 03:00:07 ⌠22 more
build 06-Nov-2020 03:00:07 Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
build 06-Nov-2020 03:00:07 at java.util.concurrent.FutureTask.report(FutureTask.java:122)
build 06-Nov-2020 03:00:07 at java.util.concurrent.FutureTask.get(FutureTask.java:206)
build 06-Nov-2020 03:00:07 at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:182)
build 06-Nov-2020 03:00:07 ⌠52 more
build 06-Nov-2020 03:00:07 Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
build 06-Nov-2020 03:00:07 at java.util.ArrayList.iterator(ArrayList.java:840)
build 06-Nov-2020 03:00:07 at java.util.Collections$UnmodifiableCollection$1.(Collections.java:1041)
build 06-Nov-2020 03:00:07 at java.util.Collections$UnmodifiableCollection.iterator(Collections.java:1040)
build 06-Nov-2020 03:00:07 at java.util.AbstractCollection.addAll(AbstractCollection.java:343)
build 06-Nov-2020 03:00:07 at java.util.HashSet.(HashSet.java:120)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.ba.deref.UnconditionalValueDerefSet.cleanDerefSet(UnconditionalValueDerefSet.java:420)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.ba.deref.UnconditionalValueDerefAnalysis.propagateDerefSetsToMergeInputValues(UnconditionalValueDerefAnalysis.java:894)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.ba.deref.UnconditionalValueDerefAnalysis.meetInto(UnconditionalValueDerefAnalysis.java:741)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis.getFactOnEdge(BasicAbstractDataflowAnalysis.java:139)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.ba.AbstractDataflow.getFactOnEdge(AbstractDataflow.java:57)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.ba.npe.NullDerefAndRedundantComparisonFinder.checkEdges(NullDerefAndRedundantComparisonFinder.java:372)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.ba.npe.NullDerefAndRedundantComparisonFinder.examineNullValues(NullDerefAndRedundantComparisonFinder.java:255)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.ba.npe.NullDerefAndRedundantComparisonFinder.execute(NullDerefAndRedundantComparisonFinder.java:164)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.detect.FindNullDeref.analyzeMethod(FindNullDeref.java:278)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.detect.FindNullDeref.visitClassContext(FindNullDeref.java:209)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1080)
build 06-Nov-2020 03:00:07 at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:281)
build 06-Nov-2020 03:00:07 at org.sonar.plugins.findbugs.FindbugsExecutor$FindbugsTask.call(FindbugsExecutor.java:235)
build 06-Nov-2020 03:00:07 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
build 06-Nov-2020 03:00:07 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
build 06-Nov-2020 03:00:07 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
build 06-Nov-2020 03:00:07 at java.lang.Thread.run(Thread.java:748)