Already disposed, I am getting this assertion error

Hi,

I am getting this assertion error, if i open an project, after close the project and open again i start to get this exception, can you guys give me an idea in what may is causing the problem?

Kind Regards
Jose Santos


Already disposed: Already disposed
java.lang.AssertionError: Already disposed
 at com.intellij.openapi.components.impl.ComponentManagerImpl.getPicoContainer(ComponentManagerImpl.java:263)
 at com.intellij.openapi.components.impl.ComponentManagerImpl.getPicoContainer(ComponentManagerImpl.java:55)
 at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:40)
 at ro.redeul.google.go.services.GoPsiManager.getInstance(GoPsiManager.java:62)
 at ro.redeul.google.go.lang.psi.typing.GoTypes.fromPsiType(GoTypes.java:85)
 at ro.redeul.google.go.lang.psi.impl.expressions.primary.GoLiteralExpressionImpl$LiteralTypeCalculator.fun(GoLiteralExpressionImpl.java:130)
 at ro.redeul.google.go.lang.psi.impl.expressions.primary.GoLiteralExpressionImpl$LiteralTypeCalculator.fun(GoLiteralExpressionImpl.java:58)
 at ro.redeul.google.go.services.GoPsiManager.getType(GoPsiManager.java:70)
 at ro.redeul.google.go.lang.psi.impl.expressions.primary.GoLiteralExpressionImpl.getType(GoLiteralExpressionImpl.java:194)
 at ro.redeul.google.go.inspection.FunctionCallInspection.checkParametersExp(FunctionCallInspection.java:187)
 at ro.redeul.google.go.inspection.FunctionCallInspection.checkFunctionTypeArguments(FunctionCallInspection.java:251)
 at ro.redeul.google.go.inspection.FunctionCallInspection.checkFunctionCallArguments(FunctionCallInspection.java:302)
 at ro.redeul.google.go.inspection.FunctionCallInspection.access$000(FunctionCallInspection.java:28)
 at ro.redeul.google.go.inspection.FunctionCallInspection$1.visitCallOrConvExpression(FunctionCallInspection.java:36)
 at ro.redeul.google.go.lang.psi.impl.expressions.primary.GoCallOrConvExpressionImpl.accept(GoCallOrConvExpressionImpl.java:78)
 at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.acceptChildren(GoPsiElementBase.java:61)
 at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14)
 at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.accept(GoPsiElementBase.java:48)
 at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.acceptChildren(GoPsiElementBase.java:61)
 at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14)
 at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.accept(GoPsiElementBase.java:48)
 at ro.redeul.google.go.lang.psi.impl.GoPsiElementBase.acceptChildren(GoPsiElementBase.java:61)
 at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14)
 at ro.redeul.google.go.lang.psi.visitors.GoElementVisitor.visitFunctionDeclaration(GoElementVisitor.java:63)
 at ro.redeul.google.go.lang.psi.impl.toplevel.GoFunctionDeclarationImpl.accept(GoFunctionDeclarationImpl.java:143)
 at ro.redeul.google.go.lang.psi.impl.GoFileImpl.acceptChildren(GoFileImpl.java:205)
 at ro.redeul.google.go.lang.psi.visitors.GoRecursiveElementVisitor.visitElement(GoRecursiveElementVisitor.java:14)
 at ro.redeul.google.go.lang.psi.visitors.GoElementVisitor.visitFile(GoElementVisitor.java:39)
 at ro.redeul.google.go.inspection.FunctionCallInspection.doCheckFile(FunctionCallInspection.java:31)
 at ro.redeul.google.go.inspection.AbstractWholeGoFileInspection.checkFile(AbstractWholeGoFileInspection.java:23)
 at com.intellij.codeInspection.LocalInspectionTool$1.visitFile(LocalInspectionTool.java:144)
 at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:70)
 at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:74)
 at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:63)
 at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:358)
 at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.access$000(LocalInspectionsPass.java:75)
 at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$3.process(LocalInspectionsPass.java:327)
 at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$3.process(LocalInspectionsPass.java:324)
 at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:119)
 at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:42)
 at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:82)
 at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1166)
 at com.intellij.concurrency.ApplierCompleter$2.run(ApplierCompleter.java:91)
 at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
 at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
 at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:103)
 at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:79)
 at jsr166e.CountedCompleter.exec(CountedCompleter.java:684)
 at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
 at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
 at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
 at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
 at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)

6 comments
Comment actions Permalink

As you can guess looking at the stack trace this exception is caused by Go language support plugin that is not developed by JetBrains. You need to contact plugin authors. Contacts are usually shown at the plugin page in Settings | Plugins or at http://plugins.jetbrains.com/

0
Comment actions Permalink

Sorry for not explain correctly, i am contributing for the go support plugin, my question is if there is an especial case, for this to happens, some thing that is common in the others plugins too.

Thanks for your response,

0
Comment actions Permalink

The instance of com.intellij.openapi.project.Project gets disposed when you close the project. When you reopen the project there's a new instance of Project created. Looks like you keep reference to the old Project somewhere.
You MUST NOT keep references to the Project anywhere where they do not die on project close. Big memory leaks happen if you keep at least one reference to the closed project.

1
Comment actions Permalink

Much thanks, this helps a lot.
Have a great day :)

0
Comment actions Permalink

I just hope that com.intellij.openapi.components.ProjectComponent dies on project close :)

0
Comment actions Permalink

Yes, all project-level components and services are handled correctly, so they can have Project field. Note that services are preferred to components because they have lazy initialization.

0

Please sign in to leave a comment.