Error in SonarLint for IntelliJ 10.11: AlreadyDisposedException

Environment:

  • Java: JetBrains s.r.o. 21.0.4
  • OS: Windows 11 amd64
  • IDE: IntelliJ IDEA 2024.2.3
  • SonarLint: 10.11.0.79648
c.ij.serviceContainer.AlreadyDisposedException: Already disposed: Module: 'lib-wicket.main' (disposed)
	at c.ij.serviceContainer.ComponentManagerImpl.checkState(ComponentManagerImpl.kt:283)
	at c.ij.serviceContainer.ComponentManagerImpl.getComponent(ComponentManagerImpl.kt:664)
	at c.ij.oa.roots.ModuleRootManager.getInstance(ModuleRootManager.java:22)
	at o.sl.ij.util.SonarLintAppUtils.getPathRelativeToModuleBaseDir(SonarLintAppUtils.java:145)
	at o.sl.ij.util.SonarLintAppUtils.getRelativePathForAnalysis(SonarLintAppUtils.java:98)
	at o.sl.ij.SonarLintIntelliJClient.listModuleFiles(SonarLintIntelliJClient.kt:735)
	at o.sl.ij.SonarLintIntelliJClient.listFiles$lambda$27$lambda$26(SonarLintIntelliJClient.kt:677)
	at o.sl.ij.util.ThreadUtilsKt.computeOnPooledThread$lambda$2(ThreadUtils.kt:47)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport$executeOnPooledThread$2.call(AnyThreadWriteThreadingSupport.kt:162)
	at c.ij.util.concurrency.ContextCallable.call(ContextCallable.java:32)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at c.ij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Hi,

Can you share what you were doing when this happened? Do you have access to the full stacktrace?

 
Thx,
Ann

Environment:

  • Java: JetBrains s.r.o. 21.0.4
  • OS: Mac OS X aarch64
  • IDE: IntelliJ IDEA 2024.3 EAP
  • SonarLint: 10.11.0.79648
c.ij.serviceContainer.AlreadyDisposedException: Container is already disposed
	at c.ij.serviceContainer.ComponentManagerImplKt.throwAlreadyDisposedIfNotUnderIndicatorOrJob(ComponentManagerImpl.kt:1670)
	at c.ij.serviceContainer.ComponentManagerImplKt.access$throwAlreadyDisposedIfNotUnderIndicatorOrJob(ComponentManagerImpl.kt:1)
	at c.ij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:721)
	at c.ij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:695)
	at c.ij.oa.project.BaseProjectDirectories$Companion.getInstance(BaseProjectDirectories.kt:64)
	at c.ij.oa.project.BaseProjectDirectories$Companion.getBaseDirectories(BaseProjectDirectories.kt:26)
	at c.ij.oa.project.ProjectUtil.guessProjectDir(ProjectUtil.kt:147)
	at o.sl.ij.util.SonarLintAppUtils.getPathRelativeToProjectBaseDir(SonarLintAppUtils.java:126)
	at o.sl.ij.util.SonarLintAppUtils.getRelativePathForAnalysis(SonarLintAppUtils.java:93)
	at o.sl.ij.SonarLintIntelliJClient.listModuleFiles(SonarLintIntelliJClient.kt:735)
	at o.sl.ij.SonarLintIntelliJClient.listFiles$lambda$27$lambda$26(SonarLintIntelliJClient.kt:677)
	at o.sl.ij.util.ThreadUtilsKt.computeOnPooledThread$lambda$2(ThreadUtils.kt:47)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport$executeOnPooledThread$2.call(AnyThreadWriteThreadingSupport.kt:154)
	at c.ij.util.concurrency.ContextCallable.lambda$call$1(ContextCallable.java:74)
	at c.ij.util.concurrency.ContextCallable.call(ContextCallable.java:83)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at c.ij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
	at c.ij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
	at c.ij.util.concurrency.ChildContext.runInChildContext(propagation.kt:107)
	at c.ij.util.concurrency.ChildContext.runInChildContext(propagation.kt:101)
	at c.ij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: c.ij.platform.instanceContainer.internal.ContainerDisposedException: Container 'ProjectImpl@20518839 services' was disposed
	at c.ij.platform.instanceContainer.internal.InstanceContainerImpl.state(InstanceContainerImpl.kt:59)
	at c.ij.platform.instanceContainer.internal.InstanceContainerImpl.state(InstanceContainerImpl.kt:39)
	at c.ij.platform.instanceContainer.internal.InstanceContainerImpl.getInstanceHolder(InstanceContainerImpl.kt:276)
	at c.ij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:717)
	... 25 more
Caused by: c.ij.platform.instanceContainer.internal.DisposalTrace
	at c.ij.platform.instanceContainer.internal.InstanceContainerImpl.dispose(InstanceContainerImpl.kt:265)

Hey Markus, could you try updating to SonarLint 10.11.1 and see if you still reproduce the issue?