Error in SonarLint for IntelliJ - Windows 10 - August 2021

Environment:

  • Java: JetBrains s.r.o. 11.0.10
  • OS: Windows 10 amd64
  • IDE: PyCharm 2021.1.1
  • SonarLint: 5.2.0.35150
java.lang.NoClassDefFoundError: org/sonar/plugins/java/api/CheckRegistrar
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
	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.infostretch.qaf.java.QAFRulesPlugin.define(QAFRulesPlugin.java:17)
	at o.ss.sl.core.container.global.ExtensionInstaller.install(ExtensionInstaller.java:72)
	at o.ss.sl.core.container.global.ExtensionInstaller.install(ExtensionInstaller.java:62)
	at o.ss.sl.core.container.global.GlobalExtensionContainer.doBeforeStart(GlobalExtensionContainer.java:36)
	at o.ss.sl.core.container.ComponentContainer.startComponents(ComponentContainer.java:124)
	at o.ss.sl.core.container.storage.StorageContainer.doAfterStart(StorageContainer.java:145)

Hello Raechel,

Welcome to the community!

From the traces I can see that you have installed on your SonarQube instance a third-party plugin that tries to add custom Java rules:

com.infostretch.qaf.java.QAFRulesPlugin

You are in the same situation as in this thread where we provided the way to fix the problem. Maintainers of this third party plugin will have to make the described changes to make the plugin compatible with SonarLint. I encourage you to get in touch with them to make the modification (I was not able to find much information about this plugin).

Hope this helps!