SonarLint throw an exception at launch (java.lang.NoClassDefFoundError: org/sonar/api/batch/Sensor)

sonarlint
intellij

(Jérôme Varani) #1

Versions

  • JetBrains IntelliJ IDEA 2018.3 (Community Edition)
  • SonarLint IDEA Plugin v4.0.0.2916
  • macOS Mojave (10.14.1)

Error observed

When opening a project, SonarLint throw the exception below. It is not possible to open the “SonarLint General Settings” preference panel.

java.lang.NoClassDefFoundError: org/sonar/api/batch/Sensor
	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.mwz.sonar.scala.ScalaPlugin.define(ScalaPlugin.scala:115)
	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.<init>(ConnectedSonarLintEngineImpl.java:77)
	at org.sonarlint.intellij.core.SonarLintEngineFactory.createEngine(SonarLintEngineFactory.java:65)
	at org.sonarlint.intellij.core.SonarLintEngineManager.getConnectedEngine(SonarLintEngineManager.java:110)
	at org.sonarlint.intellij.core.SonarLintEngineManager.getConnectedEngine(SonarLintEngineManager.java:134)
	at org.sonarlint.intellij.core.ProjectBindingManager.getFacade(ProjectBindingManager.java:73)
	at org.sonarlint.intellij.core.ProjectBindingManager.getFacade(ProjectBindingManager.java:61)
	at org.sonarlint.intellij.trigger.SonarLintSubmitter.filterAndGetByModule(SonarLintSubmitter.java:136)
	at org.sonarlint.intellij.trigger.SonarLintSubmitter.submitFiles(SonarLintSubmitter.java:119)
	at org.sonarlint.intellij.trigger.SonarLintSubmitter.submitFiles(SonarLintSubmitter.java:113)
	at org.sonarlint.intellij.trigger.EditorOpenTrigger.fileOpened(EditorOpenTrigger.java:63)
	at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
	at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:397)
	at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:358)
	at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:347)
	at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:331)
	at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:324)
	at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:29)
	at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:196)
	at com.sun.proxy.$Proxy129.fileOpened(Unknown Source)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$null$7(FileEditorManagerImpl.java:955)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$5$1.run(FileEditorManagerImpl.java:1034)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:188)
	at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:3158)
	at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:172)
	at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:124)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:179)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:185)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$null$2(FocusManagerImpl.java:193)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:668)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: org.sonar.api.batch.Sensor
	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)
	... 72 more

Steps to reproduce

Install the SonarLint plugin for IntelliJ IDEA 2018.3 Community Edition on a Mac running macOS 10.14.1.

Potential workaround

Actually, none has been founded


(Adam Gabryś) #2

Eclipse has the same problem:

Scala plugin has caused your problem: Community Scala plugin make SonarLint crash.

I didn’t find a ticket for IntelliJ.


(Jérôme Varani) #3

Thanks for the information, Adam !


(Duarte Meneses) #4

Hi,

The latest version of SonarLint for IntelliJ (4.0.1) includes a fix for the problem.
You were right, Adam, that there was no ticket documenting it. I’ve created one: https://jira.sonarsource.com/browse/SLI-323.


(Stan Clowes) #5

I have this issue in Intellij Community 2018.3.2 and latest SonarLint
There is no Scala plugin installed


(Duarte Meneses) #6

Hi, could you please list which plugins you have installed in SonarQube?


(Stan Clowes) #7

Hi

plugins installed are:

Cucumber for Java
Docker Integration
Gauge
Gherkin
Jenkinsfile IDEA Plugin
Kubernetes and OpenShift Resource Support
Lombok Plugin
Markdown Navigator
Markdown support
SonarLint
SonarQube Community Plugin

Bundled Installed Plugins:
Android Support
Ant Support
Bytecode Viewer
Copyright
Coverage
CVS Integration
Eclipse Integration
EditorConfig
Git Integration
Github
Gradle
Groovy
I18n for Hava
Intellij Configuration Script
IntellijLang
Java Bytecode Decompiler
Java Stream Debugger
JavaFX
Junit
Kotlin
Maven Integration
Plugin DevKit
Properties Support
Settings Repository
Smali Support
Subversion Integration
Task Management
Terminal
TestNG-J
UI Designer
XPath XLST Support
XSLT-Debugger
YAML

Regards
Stan


(Duarte Meneses) #8

Hi Stan,
We also need the versions of the plugins.
You can get them by querying [sonarqube_url]/api/plugins/installed
The problem is most likely caused by a plugin that is no longer supported by SonarLint.


(Stan Clowes) #9

Apologies I listed the plugins I had installed in Intellij not SonarQube.
I will see if I can get the Server plugins information

regards
Stan