Update binding - Failed to load rules in IntelliJ SonarLint

sonarlint
intellij

(Petr Strnad) #1

IntelliJ IDEA: 2018.3.4 (Ultimate Edition)
SonarLint: 4.0.2.3009
SonarQube: 6.7.3 (build 38370)

Going to IDEA’s Settings -> Other Settings -> SonarLint General Settings -> Update binding proceeds to download the rules, but eventually ends up with “Failed to load rules” error.

I have turned on verbose logs in SonarLint’s console, but there doesn’t seem to be any error present:

Create : C:\Dev\Programs\IDEA\settings\config\sonarlint\plugins
Plugin cache: C:\Dev\Programs\IDEA\settings\config\sonarlint\plugins
Create : C:\Dev\Programs\IDEA\settings\config\sonarlint\plugins\_tmp
GET 200 http://sonar.******.com/api/system/status | time=258ms
GET 200 http://sonar.******.com/api/plugins/installed | time=241ms
GET 200 http://sonar.******.com/api/settings/values.protobuf | time=256ms
Code analyzer 'checkstyle' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'findbugs' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'scmgit' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'gitlab' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'csharp' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'typescript' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'xml' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'jdepend' is not compatible with SonarLint. Skip downloading it.
GET 200 http://sonar.******.com/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&organization=default-organization&severities=INFO&p=1&ps=500 | time=521ms
GET 200 http://sonar.******.com/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&organization=default-organization&severities=MINOR&p=1&ps=500 | time=556ms
GET 200 http://sonar.******.com/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&organization=default-organization&severities=MINOR&p=2&ps=500 | time=373ms
GET 200 http://sonar.******.com/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&organization=default-organization&severities=MAJOR&p=1&ps=500 | time=552ms
Create : C:\Dev\Programs\IDEA\settings\config\sonarlint\plugins
Plugin cache: C:\Dev\Programs\IDEA\settings\config\sonarlint\plugins
Create : C:\Dev\Programs\IDEA\settings\config\sonarlint\plugins\_tmp
Load plugins
Load plugins (done) | time=2ms
Plugins:
* SonarPython 1.10.0.2131 (python)
* SonarJava 5.8.0.15699 (java)
* SonarJS 5.0.0.6962 (javascript)
Using storage for server '******' (last update 24.1.19 13:29)

(Brendon Anderson) #2

I am also seeing issues with the Intellij Plugin. I am on OSX, running Intellij Ultimate 2018.3.5 (also tried on 2018.3.4), Server Version 6.7.5 (build 38563).

I also tried replacing the jars downloaded as part of the plugin with newer versions (including building the sonarlint-intellij jar) with no luck.

The rules seem to download, then the below exception shows up in the “IDE Fatal Errors” dialog (the little exclamation mark in the lower right of the IDE).

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:62)
	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.intellij.tasks.ServerUpdateTask.run(ServerUpdateTask.java:97)
	at org.sonarlint.intellij.tasks.ServerUpdateTask$2.run(ServerUpdateTask.java:84)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:727)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
	at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:403)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
	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:745)
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)
	... 39 more

SonarLint error in Intellij