Error on Sonar Lint VsCode and sonarcloud project

Hi,

After i configure my sonarlint to check project on sonarcloud project, i have this error when vscode scanning :

Analysis failed.
Unable to load component class org.sonarsource.sonarlint.core.analyzer.sensor.PhaseExecutor

Someone have a suggestion ?
Thanks

1 Like

Hi,

I was not able to reproduce with latest SonarLint 1.5.0. Do you still see the issue? It might have been caused by an incompatible plugin that was later updated on SonarCloud.

Do you have a longer error stack to share?

Hello,

[Error - 11:29:01 AM] Analysis failed.
java.lang.IllegalStateException: Unable to load component class org.sonarsource.sonarlint.core.analyzer.sensor.PhaseExecutor
	at org.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:59)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.getComponentByType(ComponentContainer.java:258)
	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:141)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:110)
	at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:76)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:152)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:339)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:329)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:150)
	at org.sonarlint.languageserver.SonarLintLanguageServer$ConnectedAnalysisWrapper.analyze(SonarLintLanguageServer.java:718)
	at org.sonarlint.languageserver.SonarLintLanguageServer$ConnectedAnalysisWrapper.analyze(SonarLintLanguageServer.java:699)
	at org.sonarlint.languageserver.SonarLintLanguageServer.analyze(SonarLintLanguageServer.java:605)
	at org.sonarlint.languageserver.SonarLintLanguageServer.didOpen(SonarLintLanguageServer.java:539)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:61)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:148)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:216)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:183)
	at org.eclipse.lsp4j.jsonrpc.Launcher$Builder.lambda$wrapMessageConsumer$0(Launcher.java:308)
	at org.eclipse.lsp4j.jsonrpc.validation.ReflectiveMessageValidator.consume(ReflectiveMessageValidator.java:71)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:188)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:90)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:95)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonarsource.sonarlint.core.analyzer.sensor.AllSensorsExecutor
	at org.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:59)
	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.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)
	... 33 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonarsource.sonarlint.core.analyzer.sensor.LtsApiSensorContext
	at org.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:59)
	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.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)
	... 47 more
Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.api.batch.rule.ActiveRules
	at org.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:59)
	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.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)
	... 61 more
Caused by: java.lang.IllegalStateException: Rule 'php:S121' is already activated
	at org.sonar.api.batch.rule.internal.ActiveRulesBuilder.activate(ActiveRulesBuilder.java:44)
	at org.sonar.api.batch.rule.internal.NewActiveRule.activate(NewActiveRule.java:96)
	at org.sonarsource.sonarlint.core.container.storage.SonarQubeActiveRulesProvider.createNewActiveRule(SonarQubeActiveRulesProvider.java:105)
	at org.sonarsource.sonarlint.core.container.storage.SonarQubeActiveRulesProvider.provide(SonarQubeActiveRulesProvider.java:72)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
	at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
	at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
	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.sonarsource.sonarlint.core.container.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)

I hope that help us

And i have this configuration :

"sonarlint.connectedMode.servers": [{
        "serverId": "webreact",
        "serverUrl": "https://sonarcloud.io/",
        "organizationKey": "XX",
        "token" :"XXXXX"
    }],
    "sonarlint.connectedMode.project": {
        "serverId": "webreact",
        "projectKey": "XXXX"
    },
    "sonarlint.ls.javaHome": "C:\\Program Files\\Java\\jre1.8.0_161",

Hi,

You don’t have the problem in standalone mode right (=not connected). Can you give us the list of all plugins installed on your server:
http:///api/plugins/installed

Thanks

Hi,

I’am on sonarcloud. So this is the Url : https://sonarcloud.io/api/plugins/installed

Thanks

My bad, I missed that from your previous post.

Can you please try:

  1. Open the SonarLint Output panel in VSCode
  2. Clear it
  3. Open command palette (Ctrl + Shift + P on my box) + execute “Update SonarLint binding to SonarQube/SonarCloud”

Check there are no errors in logs.

I tried to reproduce by binding to SonarCloud by I was not able.

Are you using a custom quality profile for your project?

For your information we finally managed to find the root cause of this issue: