Project is already disposed exception

What does "Project is already disposed" mean ?

I'm getting an exception with this message when i do:

WebUtil.getWebModuleProperties(getModule()).getRoot()

I'm sure i had this working before.
Any ideas ?

Thanks,

Hugo

5 comments

you can first check project.isDisposed() to avoid this exception

0

Thanks but i don't think that solves my problem.
Both getModule().isDisposed() and getModule().getProject().isDisposed() are false just before i call the line that throws the exception.

Maybe the full stack trace will help:

java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at com.intellij.psi.impl.file.impl.FileManagerImpl.b(FileManagerImpl.java:443)
at com.intellij.psi.impl.file.impl.FileManagerImpl.findFile(FileManagerImpl.java:288)
at com.intellij.psi.impl.PsiManagerImpl.findFile(PsiManagerImpl.java:285)
at com.intellij.javaee.module.JavaeeDeploymentDescriptorBase.getXmlFile(JavaeeDeploymentDescriptorBase.java:18)
at com.intellij.javaee.module.components.WebModulePropertiesImpl.getRoot(WebModulePropertiesImpl.java:70)
at com.intellij.tapestry.core.TapestryApplicationModel.getApplicationServletName(TapestryApplicationModel.java:276)
at com.intellij.tapestry.core.TapestryApplicationModel.getApplicationName(TapestryApplicationModel.java:123)
at com.intellij.tapestry.core.TapestryApplicationModel.initApplicationSpecification(TapestryApplicationModel.java:239)
at com.intellij.tapestry.core.TapestryApplicationModel.getApplicationSpecification(TapestryApplicationModel.java:227)
at com.intellij.tapestry.core.TapestryApplicationModel.getLibraries(TapestryApplicationModel.java:190)
at com.intellij.tapestry.palette.ui.PaletteTreeNode.]]>(PaletteTreeNode.java:60)
at com.intellij.tapestry.palette.ui.PaletteWindow$3.moduleAdded(PaletteWindow.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.util.PendingEventDispatcher.a(PendingEventDispatcher.java:83)
at com.intellij.util.PendingEventDispatcher.a(PendingEventDispatcher.java:70)
at com.intellij.util.PendingEventDispatcher.access$100(PendingEventDispatcher.java:8)
at com.intellij.util.PendingEventDispatcher$1.invoke(PendingEventDispatcher.java:11)
at $Proxy30.moduleAdded(Unknown Source)
at com.intellij.openapi.module.impl.ModuleManagerImpl.a(ModuleManagerImpl.java:74)
at com.intellij.openapi.module.impl.ModuleManagerImpl.access$1600(ModuleManagerImpl.java:124)
at com.intellij.openapi.module.impl.ModuleManagerImpl$6.run(ModuleManagerImpl.java:4)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:365)
at com.intellij.openapi.module.impl.ModuleManagerImpl.projectOpened(ModuleManagerImpl.java:112)
at com.intellij.openapi.project.impl.ProjectImpl.c(ProjectImpl.java:134)
at com.intellij.openapi.project.impl.ProjectImpl.access$200(ProjectImpl.java:6)
at com.intellij.openapi.project.impl.ProjectImpl$MyProjectManagerListener.projectOpened(ProjectImpl.java:0)
at com.intellij.openapi.project.impl.ProjectManagerImpl$1.projectOpened(ProjectManagerImpl.java:11)
at com.intellij.openapi.project.impl.ProjectManagerImpl.d(ProjectManagerImpl.java:40)
at com.intellij.openapi.project.impl.ProjectManagerImpl.openProject(ProjectManagerImpl.java:23)
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(ProjectManagerImpl.java:144)
at com.intellij.ide.impl.ProjectUtil.openProject(ProjectUtil.java:26)
at com.intellij.idea.IdeaApplication.c(IdeaApplication.java:9)
at com.intellij.idea.IdeaApplication.access$400(IdeaApplication.java:56)
at com.intellij.idea.IdeaApplication$IdeStarter$2.run(IdeaApplication.java:5)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:6)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:163)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:8)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:145)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
ERROR - impl.file.impl.FileManagerImpl - Project is already disposed
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at com.intellij.psi.impl.file.impl.FileManagerImpl.b(FileManagerImpl.java:443)
at com.intellij.psi.impl.file.impl.FileManagerImpl.findFile(FileManagerImpl.java:288)
at com.intellij.psi.impl.PsiManagerImpl.findFile(PsiManagerImpl.java:285)
at com.intellij.javaee.module.JavaeeDeploymentDescriptorBase.getXmlFile(JavaeeDeploymentDescriptorBase.java:18)
at com.intellij.javaee.module.components.WebModulePropertiesImpl.getRoot(WebModulePropertiesImpl.java:70)
at com.intellij.tapestry.core.TapestryApplicationModel.getApplicationServletName(TapestryApplicationModel.java:276)
at com.intellij.tapestry.core.TapestryApplicationModel.getApplicationName(TapestryApplicationModel.java:123)
at com.intellij.tapestry.core.TapestryApplicationModel.initApplicationSpecification(TapestryApplicationModel.java:239)
at com.intellij.tapestry.core.TapestryApplicationModel.getApplicationSpecification(TapestryApplicationModel.java:227)
at com.intellij.tapestry.core.TapestryApplicationModel.getLibraries(TapestryApplicationModel.java:190)
at com.intellij.tapestry.palette.ui.PaletteTreeNode.]]>(PaletteTreeNode.java:60)
at com.intellij.tapestry.palette.ui.PaletteWindow$3.moduleAdded(PaletteWindow.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.util.PendingEventDispatcher.a(PendingEventDispatcher.java:83)
at com.intellij.util.PendingEventDispatcher.a(PendingEventDispatcher.java:70)
at com.intellij.util.PendingEventDispatcher.access$100(PendingEventDispatcher.java:8)
at com.intellij.util.PendingEventDispatcher$1.invoke(PendingEventDispatcher.java:11)
at $Proxy30.moduleAdded(Unknown Source)
at com.intellij.openapi.module.impl.ModuleManagerImpl.a(ModuleManagerImpl.java:74)
at com.intellij.openapi.module.impl.ModuleManagerImpl.access$1600(ModuleManagerImpl.java:124)
at com.intellij.openapi.module.impl.ModuleManagerImpl$6.run(ModuleManagerImpl.java:4)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:365)
at com.intellij.openapi.module.impl.ModuleManagerImpl.projectOpened(ModuleManagerImpl.java:112)
at com.intellij.openapi.project.impl.ProjectImpl.c(ProjectImpl.java:134)
at com.intellij.openapi.project.impl.ProjectImpl.access$200(ProjectImpl.java:6)
at com.intellij.openapi.project.impl.ProjectImpl$MyProjectManagerListener.projectOpened(ProjectImpl.java:0)
at com.intellij.openapi.project.impl.ProjectManagerImpl$1.projectOpened(ProjectManagerImpl.java:11)
at com.intellij.openapi.project.impl.ProjectManagerImpl.d(ProjectManagerImpl.java:40)
at com.intellij.openapi.project.impl.ProjectManagerImpl.openProject(ProjectManagerImpl.java:23)
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(ProjectManagerImpl.java:144)
at com.intellij.ide.impl.ProjectUtil.openProject(ProjectUtil.java:26)
at com.intellij.idea.IdeaApplication.c(IdeaApplication.java:9)
at com.intellij.idea.IdeaApplication.access$400(IdeaApplication.java:56)
at com.intellij.idea.IdeaApplication$IdeStarter$2.run(IdeaApplication.java:5)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:6)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:163)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:8)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:145)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
ERROR - impl.file.impl.FileManagerImpl - IntelliJ IDEA 6.0.1 Build #5784
ERROR - impl.file.impl.FileManagerImpl - JDK: 1.5.0_08
ERROR - impl.file.impl.FileManagerImpl - VM: Java HotSpot(TM) Client VM
ERROR - impl.file.impl.FileManagerImpl - Vendor: Sun Microsystems Inc.
ERROR - impl.file.impl.FileManagerImpl - OS: Linux
ERROR - impl.file.impl.FileManagerImpl - Last Action:

0

The exception is only thrown if i execute the given code from the moduleAdded event.
I guess the module/project hasn't been initialized properly when the moduleAdded method of plugin components is called.

This worked fine before so i guess it's got to be either a bug or a semantics change in the API.

0

This was solved in the created issue.

0

Please sign in to leave a comment.