在IntelliJ中设置SonarLint时发生异常

阿尔伯特

我正在使用IntelliJ(v2018.1.2)并尝试使SonarLint(3.3.0.2482)插件正常工作。当我Configure SonarLint在SonarLint面板上选择Configure Servers...检查后单击时Enable binding to remote SonarQube server它什么也没有做,并给我以下错误。

SonarLint安装指南说,您只需要Java 8(我拥有(1.8.0)),然后从Plugins目录->浏览存储库进行安装即可。我尝试过更新IntelliJ和SonarLint,并删除了IntelliJ中未自动包含的所有插件,以查看它们是否正在交互,但不确定从何而来。还有其他人遇到吗?谢谢阅读。

IntelliJ异常

完整的异常文本在这里:

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
阿尔伯特

在SonarLint google组上,建议SonarLint正在拉入旧版本的插件并检查插件库的内容。该版本的内容为:

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

已被验证为正确。另外,建议清除... / config / plugins / SonarLint中的所有本地存储,以删除本地数据缓存。

我还从IntelliJ中删除了本地缓存的任何先前版本,这些版本显然在每次发行后都不会清除。

进行上述操作解决了该问题。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章