How to scan the java projects which uses Atlassian SDK for compiling

Hi Team,

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

Hi,

Welcome to the community!

What’s you version of SonarQube? You’ll find it in the page footer.

 
Ann

Hi @ganncamp Thanks for the quick response, My sonar version is 7.4 (build 18908) and i have tried with sonar scanner sonar-scanner-4.0.0.1744-linux

Thanks,
Sunil Palugula

Hi @ganncamp Did you get chance to looks at my comment?

Thanks in advance for your help!!!

Thanks,
Sunil Palugula

Hi Sunil,

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.

 
Ann

Hi @ganncamp Since upgrade takes time, Just like to know if we scan for the project which are using Atlassian SDK for compiling?

Thanks,
Sunil Palugula

Hi Sunil,

Sorry, but I don’t understand the question.

 
Ann

I have java project which will be compiled using AtlassainSDK and now i would like to scan that project using Sonar.

Need to know how we can scan this project which uses AtlassainSDK instead of regular JDK. Can you please list the steps to scan this project?

Thanks,
Sunil Palugula

Hi Sunil,

The JDK you compile with doesn’t matter as long as you analyze with a compatible JDK.

 
HTH,
Ann

I am not able to scan the project and below is my build command.

/opt/atlassian-plugin-sdk-6.2.14/bin/atlas-mvn clean package

Thanks,
Sunil Palugula