SonarLint Eclipse Binding Fails with org/sonar/api/batch/AbstractCpdMapping

With a new install of SonarLint 4.1.0 from the Eclipse Marketplace in Eclipse 4.7.3, seeing this error when binding to our SonarQube 6.7.5 (build 38563) server:

An internal error occurred during: “Update SonarLint binding data from ‘our.server’”.
org/sonar/api/batch/AbstractCpdMapping

The stacktrace from the Eclipse Error Log is as follows:

java.lang.NoClassDefFoundError: org/sonar/api/batch/AbstractCpdMapping
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125)
	at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37)
	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
	at com.villagechief.sonar.salesforce.SalesForcePlugin.getExtensions(SalesForcePlugin.java:110)
	at org.sonar.api.SonarPlugin.define(SonarPlugin.java:51)
	at org.sonarsource.sonarlint.core.container.global.ExtensionInstaller.install(ExtensionInstaller.java:61)
	at org.sonarsource.sonarlint.core.container.global.GlobalExtensionContainer.doBeforeStart(GlobalExtensionContainer.java:35)
    at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonarsource.sonarlint.core.container.storage.StorageContainer.doAfterStart(StorageContainer.java:126)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:118)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$update$2(ConnectedSonarLintEngineImpl.java:176)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withRwLock(ConnectedSonarLintEngineImpl.java:325)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.update(ConnectedSonarLintEngineImpl.java:169)
	at org.sonarlint.eclipse.core.internal.server.Server.updateStorage(Server.java:326)
	at org.sonarlint.eclipse.core.internal.jobs.ServerUpdateJob.run(ServerUpdateJob.java:50)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.lang.ClassNotFoundException: org.sonar.api.batch.AbstractCpdMapping
	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)
	... 27 more

Based on Plugin issues with Eclipse - can't create view - #5 by Julien_HENRY it looks like the issue is with the SalesForce plugin. While our project does not use SalesForce, it is likely that another project sharing the SonarQube does. Is there a way to exclude this from our binding? If not is an older version of the SonarLint plugin compatible and where would I get that from?

Also based on the above link, I would have expected an error message identifying the incompatible plugin rather than needing to search through the stack trace. Not sure if that is implemented for Eclipse version.

SonarLint only supports the code analyzers from SonarSouce. The SalesForcePlugin developed by VillageChief is declaring itself as compatible with SonarLint, which isn’t correct.

It seems they forked multiple SonarSource projects (https://github.com/VillageChief) and you probably must use their fork of “SonarLint for Eclipse”. You could also remove this plugin from your SonarQube server or ask the plugin developers for a patched version of their plugin.

1 Like