Error in SonarLint for IntelliJ

Environment:

  • Java: JetBrains s.r.o. 21.0.5
  • OS: Windows 11 amd64
  • IDE: IntelliJ IDEA 2024.3
  • CodeScan: 7.2.2

SonarAnalyzeFilesAction#presentation@ProjectViewPopup (org.sonarlint.intellij.actions.SonarAnalyzeFilesAction), actionId=SonarLint.AnalyzeFiles, text=‘Analyze with SonarLint’

java.lang.ClassCastException: class o.sl.ij.core.BackendService cannot be cast to class o.sl.ij.core.BackendService (o.sl.ij.core.BackendService is in unnamed module of loader c.ij.ide.plugins.cl.PluginClassLoader @3305e9a1; o.sl.ij.core.BackendService is in unnamed module of loader c.ij.ide.plugins.cl.PluginClassLoader @28387fed)
	at o.sl.ij.actions.SonarAnalyzeFilesAction.isEnabled(SonarAnalyzeFilesAction.java:54)
	at o.sl.ij.actions.AbstractSonarAction.update(AbstractSonarAction.java:66)
	at c.ij.oa.actionSystem.ex.ActionUtil.performDumbAwareUpdate$lambda$2(ActionUtil.kt:226)
	at c.ij.oa.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.kt:244)
	at c.ij.oa.actionSystem.impl.ActionUpdater$updateAction$success$1$1$1.invoke(ActionUpdater.kt:501)
	at c.ij.oa.actionSystem.impl.ActionUpdater$updateAction$success$1$1$1.invoke(ActionUpdater.kt:500)
	at c.ij.oa.actionSystem.impl.ActionUpdater$callAction$2$1.invoke(ActionUpdater.kt:145)
	at c.ij.oa.application.rw.InternalReadAction.insideReadAction(InternalReadAction.kt:114)
	at c.ij.oa.application.rw.InternalReadAction.tryReadCancellable$lambda$4(InternalReadAction.kt:104)
	at c.ij.oa.application.rw.CancellableReadActionKt.cancellableReadActionInternal$lambda$3$lambda$2$lambda$1(cancellableReadAction.kt:32)

Hello @TaterTot, this is a strange error as there is a single classloader per plugin, this should not happen.

I see that you are using CodeScan, a fork of SonarLint IntelilJ that is not maintained by us. I would suggest verifying that you only have CodeScan or SonarLint installed, but not both at the same time. If the issue persists, please try to reinstall the plugin or the IDE.