Search code examples
intellij-ideasonarlintsonarlint-intellij

Exception during setting up SonarLint in IntelliJ


I am using IntelliJ (v2018.1.2) and trying to get the SonarLint (3.3.0.2482) plugin to work. When I select Configure SonarLint on the SonarLint panel and click Configure Servers... after checking Enable binding to remote SonarQube server it does nothing and gives me the following error.

The SonarLint installation guide says that all you need is Java 8, which I have (1.8.0) and to install it from the Plugins directory -> browse repositories which I did. I've tried updating IntelliJ and SonarLint and removing any plugins that aren't automatically included in IntelliJ and to see if they were interacting but unsure where to go from here. Anyone else encounter this? Thanks for reading.

IntelliJ Exception

Full exception text is here:

com/google/common/collect/ImmutableList
java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableList
    at org.sonar.plugins.java.JavaPlugin.getExtensions(JavaPlugin.java:50)
    at org.sonar.api.SonarPlugin.define(SonarPlugin.java:51)
    at org.sonarsource.sonarlint.core.container.global.ExtensionInstaller.install(ExtensionInstaller.java:55)
    at org.sonarsource.sonarlint.core.container.global.GlobalExtensionContainer.doBeforeStart(GlobalExtensionContainer.java:37)
    at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:123)
    at org.sonarsource.sonarlint.core.container.storage.StorageContainer.doAfterStart(StorageContainer.java:118)
    at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
    at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:120)
    at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.<init>(ConnectedSonarLintEngineImpl.java:79)
    at org.sonarlint.intellij.core.SonarLintEngineFactory.createEngine(SonarLintEngineFactory.java:63)
    at org.sonarlint.intellij.core.SonarLintEngineManager.getConnectedEngine(SonarLintEngineManager.java:110)
    at org.sonarlint.intellij.config.global.SonarQubeServerMgmtPanel.switchTo(SonarQubeServerMgmtPanel.java:283)
    at org.sonarlint.intellij.config.global.SonarQubeServerMgmtPanel.onServerSelect(SonarQubeServerMgmtPanel.java:272)
    at org.sonarlint.intellij.config.global.SonarQubeServerMgmtPanel.lambda$create$0(SonarQubeServerMgmtPanel.java:121)
    at javax.swing.JList.fireSelectionValueChanged(JList.java:1796)
    at javax.swing.JList$ListSelectionHandler.valueChanged(JList.java:1810)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:184)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:164)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:211)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:405)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:415)
    at javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:459)
    at javax.swing.JList.setSelectedIndex(JList.java:2210)
    at javax.swing.JList.setSelectedValue(JList.java:2360)
    at org.sonarlint.intellij.config.global.SonarQubeServerMgmtPanel.load(SonarQubeServerMgmtPanel.java:262)
    at org.sonarlint.intellij.config.global.SonarLintGlobalConfigurable.reset(SonarLintGlobalConfigurable.java:98)
    at com.intellij.openapi.options.ex.ConfigurableCardPanel.reset(ConfigurableCardPanel.java:124)
    at com.intellij.openapi.options.ex.ConfigurableCardPanel.lambda$createConfigurableComponent$0(ConfigurableCardPanel.java:82)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:927)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:47)
    at com.intellij.openapi.options.ex.ConfigurableCardPanel.createConfigurableComponent(ConfigurableCardPanel.java:69)
    at com.intellij.openapi.options.ex.ConfigurableCardPanel.create(ConfigurableCardPanel.java:55)
    at com.intellij.openapi.options.newEditor.ConfigurableEditor$1.create(ConfigurableEditor.java:73)
    at com.intellij.openapi.options.newEditor.ConfigurableEditor$1.create(ConfigurableEditor.java:70)
    at com.intellij.ui.CardLayoutPanel.createValue(CardLayoutPanel.java:88)
    at com.intellij.ui.CardLayoutPanel.select(CardLayoutPanel.java:116)
    at com.intellij.ui.CardLayoutPanel.select(CardLayoutPanel.java:101)
    at com.intellij.openapi.options.newEditor.ConfigurableEditor.<init>(ConfigurableEditor.java:114)
    at com.intellij.openapi.options.newEditor.SettingsDialog.<init>(SettingsDialog.java:49)
    at com.intellij.openapi.options.newEditor.SettingsDialogFactory.create(SettingsDialogFactory.java:37)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.editConfigurable(ShowSettingsUtilImpl.java:231)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.editConfigurable(ShowSettingsUtilImpl.java:217)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.editConfigurable(ShowSettingsUtilImpl.java:212)
    at org.sonarlint.intellij.config.project.SonarLintProjectBindPanel.actionConfigureServers(SonarLintProjectBindPanel.java:288)
    at org.sonarlint.intellij.config.project.SonarLintProjectBindPanel.access$100(SonarLintProjectBindPanel.java:67)
    at org.sonarlint.intellij.config.project.SonarLintProjectBindPanel$1.actionPerformed(SonarLintProjectBindPanel.java:223)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6541)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
    at java.awt.Component.processEvent(Component.java:6306)
    at java.awt.Container.processEvent(Container.java:2237)
    at java.awt.Component.dispatchEventImpl(Component.java:4897)
    at java.awt.Container.dispatchEventImpl(Container.java:2295)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
    at java.awt.Container.dispatchEventImpl(Container.java:2281)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    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.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:737)
    at java.awt.EventQueue$4.run(EventQueue.java:735)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:779)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:716)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:395)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
    at java.awt.Dialog.show(Dialog.java:1077)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:694)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:426)
    at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1688)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1637)
    at com.intellij.openapi.options.newEditor.SettingsDialog.lambda$show$0(SettingsDialog.java:69)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:153)
    at com.intellij.openapi.options.newEditor.SettingsDialog.show(SettingsDialog.java:69)
    at com.intellij.openapi.ui.DialogWrapper.showAndGet(DialogWrapper.java:1652)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.editConfigurable(ShowSettingsUtilImpl.java:241)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.editConfigurable(ShowSettingsUtilImpl.java:202)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.editConfigurable(ShowSettingsUtilImpl.java:191)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.editConfigurable(ShowSettingsUtilImpl.java:175)
    at org.sonarlint.intellij.actions.SonarConfigureProject.actionPerformed(SonarConfigureProject.java:38)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237)
    at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:193)
    at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:153)
    at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:357)
    at java.awt.Component.processEvent(Component.java:6306)
    at java.awt.Container.processEvent(Container.java:2237)
    at java.awt.Component.dispatchEventImpl(Component.java:4897)
    at java.awt.Container.dispatchEventImpl(Container.java:2295)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
    at java.awt.Container.dispatchEventImpl(Container.java:2281)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    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.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:737)
    at java.awt.EventQueue$4.run(EventQueue.java:735)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:779)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:716)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:395)
    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: com.google.common.collect.ImmutableList
    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)
    ... 139 more

Solution

  • On the SonarLint google group, it was suggested that SonarLint was pulling in an older version of a plugin and to check the contents of the plugin lib. The contents for this version were:

    commons-lang-2.6.jar 
    jsr305-2.0.2.jar 
    sonarlint-client-api-3.3.0.1492.jar 
    sonarlint-core-3.3.0.1492.jar 
    sonarlint-intellij-3.3.0.2482.jar
    

    Which was verified as correct. Also, it was suggested to clear out all local storage in .../config/plugins/SonarLint to remove the local data cache.

    I also removed any previous version of local caches from IntelliJ which apparently do not get cleaned up after each release.

    Doing the above resolved the issue.