Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Project is already disposed" exceptions after closing a project and opening another one #1222

Closed
fbricon opened this issue Oct 10, 2023 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Oct 10, 2023

java.lang.IllegalStateException: Module vscode-marketplace is already disposed
	at org.jetbrains.kotlin.idea.project.ModulePlatformCache.checkKeyValidity(ModulePlatformCache.kt:22)
	at org.jetbrains.kotlin.idea.project.ModulePlatformCache.checkKeyValidity(ModulePlatformCache.kt:15)
	at org.jetbrains.kotlin.idea.base.util.caching.FineGrainedEntityCache.checkKeyConsistency(FineGrainedEntityCache.kt:210)
	at org.jetbrains.kotlin.idea.base.util.caching.FineGrainedEntityCache.checkEntities(FineGrainedEntityCache.kt:184)
	at org.jetbrains.kotlin.idea.base.util.caching.FineGrainedEntityCache.access$checkEntities(FineGrainedEntityCache.kt:20)
	at org.jetbrains.kotlin.idea.base.util.caching.FineGrainedEntityCache$invalidateKeys$1.invoke(FineGrainedEntityCache.kt:149)
	at org.jetbrains.kotlin.idea.base.util.caching.FineGrainedEntityCache$invalidateKeys$1.invoke(FineGrainedEntityCache.kt:144)
	at org.jetbrains.kotlin.idea.base.util.caching.SynchronizedFineGrainedEntityCache.useCache(FineGrainedEntityCache.kt:271)
	at org.jetbrains.kotlin.idea.base.util.caching.FineGrainedEntityCache.invalidateKeys(FineGrainedEntityCache.kt:144)
	at org.jetbrains.kotlin.idea.base.util.caching.FineGrainedEntityCache.invalidateKeys$default(FineGrainedEntityCache.kt:139)
	at org.jetbrains.kotlin.idea.project.ModulePlatformCache$ModelChangeListener.entitiesChanged(ModulePlatformCache.kt:36)
	at org.jetbrains.kotlin.idea.base.util.caching.WorkspaceEntityChangeListener.handleEvent(WorkspaceEntityChangeListener.kt:49)
	at org.jetbrains.kotlin.idea.base.util.caching.WorkspaceEntityChangeListener.changed(WorkspaceEntityChangeListener.kt:35)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:699)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:659)
	at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:491)
	at com.intellij.util.messages.impl.MessagePublisher.publish$intellij_platform_core(MessageBusImpl.kt:471)
	at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:448)
	at jdk.proxy2/jdk.proxy2.$Proxy71.changed(Unknown Source)
	at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl$onChanged$3.invoke(WorkspaceModelImpl.kt:347)
	at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl$onChanged$3.invoke(WorkspaceModelImpl.kt:346)
	at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.logErrorOnEventHandling(WorkspaceModelImpl.kt:386)
	at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.onChanged(WorkspaceModelImpl.kt:346)
	at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.access$onChanged(WorkspaceModelImpl.kt:36)
	at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl$updateProjectModel$generalTime$1$7.invoke(WorkspaceModelImpl.kt:161)
	at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl$updateProjectModel$generalTime$1$7.invoke(WorkspaceModelImpl.kt:161)
	at com.intellij.platform.workspace.storage.impl.VersionedEntityStorageImpl.replace(VersionedEntityStorageImpl.kt:190)
	at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.updateProjectModel(WorkspaceModelImpl.kt:161)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.ModifiableRootModelBridgeImpl.commit(ModifiableRootModelBridgeImpl.kt:569)
	at com.intellij.openapi.application.WriteAction.lambda$run$1(WriteAction.java:87)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:980)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1006)
	at com.intellij.openapi.application.WriteAction.run(WriteAction.java:86)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.lambda$modifyModel$11(ModuleRootModificationUtil.java:163)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:458)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:490)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.modifyModel(ModuleRootModificationUtil.java:161)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel(ModuleRootModificationUtil.java:151)
	at com.redhat.devtools.intellij.quarkus.QuarkusModuleUtil.ensureQuarkusLibrary(QuarkusModuleUtil.java:99)
	at com.redhat.devtools.intellij.quarkus.QuarkusProjectService.moduleAdded(QuarkusProjectService.java:75)
	at com.intellij.openapi.project.ModuleListener.modulesAdded(ModuleListener.java:29)

And another one here:

  Error executing task com.intellij.openapi.project.SmartModeScheduler$RunnableDelegate@14b8ff0e
  
  com.intellij.serviceContainer.AlreadyDisposedException: Already disposed: Module: 'vscode-marketplace' (disposed)
at com.intellij.serviceContainer.ComponentManagerImpl.checkState(ComponentManagerImpl.kt:199)
at com.intellij.serviceContainer.ComponentManagerImpl.getComponent(ComponentManagerImpl.kt:593)
at com.intellij.openapi.roots.ModuleRootManager.getInstance(ModuleRootManager.java:36)
at com.intellij.openapi.module.impl.scopes.ModuleWithDependenciesScope.getOrderEnumeratorForOptions(ModuleWithDependenciesScope.java:91)
at com.intellij.openapi.module.impl.scopes.ModuleWithDependenciesScope.calcRoots(ModuleWithDependenciesScope.java:72)
at com.intellij.openapi.module.impl.scopes.ModuleWithDependenciesScope.<init>(ModuleWithDependenciesScope.java:66)
at com.intellij.openapi.module.impl.scopes.ModuleScopeProviderImpl.getCachedScope(ModuleScopeProviderImpl.java:29)
at com.intellij.openapi.module.impl.scopes.ModuleScopeProviderImpl.getModuleScope(ModuleScopeProviderImpl.java:44)
at com.intellij.openapi.module.impl.ModuleImpl.getModuleScope(ModuleImpl.kt:197)
at com.redhat.devtools.intellij.lsp4mp4ij.psi.core.PropertiesManager.createSearchScope(PropertiesManager.java:163)
at com.redhat.devtools.intellij.lsp4mp4ij.psi.core.PropertiesManager.getMicroProfileProjectInfo(PropertiesManager.java:110)
at com.redhat.devtools.intellij.quarkus.QuarkusProjectService.lambda$computeSchema$1(QuarkusProjectService.java:107)
@fbricon fbricon added the bug Something isn't working label Oct 10, 2023
@angelozerr
Copy link
Contributor

For the first issue, it should be fixed #1221 since we consume QuarkusModuleUtil.ensureQuarkusLibrary only when we need (when getProjectInfo is called) and not when a module is added

@angelozerr
Copy link
Contributor

@fbricon I think we can close this issue since Quarkus Deployment support has been refactored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants