SonarQubeSever6.7 and SonarLint3.2 Analysis failure

Greetings to all,
I am using Eclipse Neon2 and the SonarLint3.2 (3.2.0.201706271328) and a remote SonarQube Server 6.7.5
The binding is completed successfully but I cannot run any analysis.
I got the exception below.
Please advise.

Thx & BR

Starting SonarLint for Eclipse 3.2.0.201706271328
:::::::::::
:::::::::::
Error during execution of SonarLint analysis
java.lang.IllegalStateException: Unable to register extension org.sonar.java.JavaSonarLintClasspath
	at org.sonarsource.sonarlint.core.container.ComponentContainer.addExtension(ComponentContainer.java:234)
	at org.sonarsource.sonarlint.core.container.global.ExtensionInstaller.loadExtensions(ExtensionInstaller.java:78)
	at org.sonarsource.sonarlint.core.container.global.ExtensionInstaller.install(ExtensionInstaller.java:54)
	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.addPluginExtensions(AnalysisContainer.java:137)
	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doBeforeStart(AnalysisContainer.java:71)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:110)
	at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:72)
	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:69)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:154)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl$$Lambda$221/780981043.get(Unknown Source)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:338)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:328)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:152)
	at org.sonarlint.eclipse.core.internal.server.Server.runAnalysis(Server.java:275)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.run(AnalyzeProjectJob.java:426)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.runAnalysisAndUpdateMarkers(AnalyzeProjectJob.java:182)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.doRun(AnalyzeProjectJob.java:143)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.runInWorkspace(AbstractSonarProjectJob.java:43)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.runInWorkspace(AnalyzeChangedFilesJob.java:91)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NoClassDefFoundError: Lorg/sonar/api/config/Configuration;
	at java.lang.Class.getDeclaredFields0(Native Method)
	at java.lang.Class.privateGetDeclaredFields(Class.java:2570)
	at java.lang.Class.getDeclaredFields(Class.java:1903)
	at org.picocontainer.injectors.AdaptingInjection$2.run(AdaptingInjection.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.picocontainer.injectors.AdaptingInjection.injectionFieldAnnotated(AdaptingInjection.java:209)
	at org.picocontainer.injectors.AdaptingInjection.fieldAnnotatedInjectionAdapter(AdaptingInjection.java:188)
	at org.picocontainer.injectors.AdaptingInjection.createComponentAdapter(AdaptingInjection.java:57)
	at org.picocontainer.behaviors.AbstractBehaviorFactory.createComponentAdapter(AbstractBehaviorFactory.java:44)
	at org.picocontainer.behaviors.OptInCaching.createComponentAdapter(OptInCaching.java:45)
	at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:536)
	at org.picocontainer.DefaultPicoContainer.access$300(DefaultPicoContainer.java:84)
	at org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer.addComponent(DefaultPicoContainer.java:1149)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.addExtension(ComponentContainer.java:232)
	... 21 more
Caused by: java.lang.ClassNotFoundException: org.sonar.api.config.Configuration
	at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
	... 35 more

Hi,

The version of SonarLint you are using is too old to be compatible with the SonarJava analyzer that is installed on your SonarQube server. Please update and it will fix your error. Latest version is 3.6.

1 Like

Hi,
Thx a lot for the quick reply.
I am having the following issue with my eclipse:
On the Eclipse Marketplace it shows that I have the SonarLint 3.6 installed (if I recall correctly, I installed the 3.2 and not the 3.6 last year).
When I clicked on the uninstall button, I got the following message and could not uninstall:
image
On the Eclipse Installation Details, I found the following info:
On the Installed Software tab, I see the SonarLint 3.2
SonarLint for Eclipse 3.2.0.201706271328 org.sonarlint.eclipse.feature.feature.group SonarSource

On the installation history it shows the following:
SonarLint for Eclipse 3.2.0.201706271328

On the Features tab it shows two sonarlints, the old 2.5.1 and the current 3.2
SonarLint for Eclipse 3.2.0.201706271328 org.sonarlint.eclipse.feature.feature.group SonarSource
SonarLint for Eclipse 3.2.0.201706271328 org.sonarlint.eclipse.feature.feature.group SonarSource

On the Plugins tab, I see all the related entries for both lint versions i.e. the core-client API etc…

Presently, I cannot uninstall the existing 3.2, nor update it.
Is there a way to uninstall it manually? i.e. by deleting some jar/files/folders etc…
Also, how do I install/update the existing one manually? which URL should I use?
Please let me know.

Thx again and BR

The correct entries for the Features:


Sorry for this inconvenience.

BR

It seems your Eclipse installation is in a bad shape. I would suggest to:

  • close Eclipse
  • clean <eclipse dir>/plugins and <eclipse dir>/features folders by removing any reference to SonarLint/SonarSource
  • start Eclipse from a shell with option -clean
  • install SonarLint 3.6