holgerbrandl / r4intellij

An integration of the R programming language into Intellij IDEA
BSD 2-Clause "Simplified" License
148 stars 28 forks source link

java.lang.AssertionError: Already disposed: Project (Disposed) hello-world #192

Open G-Rath opened 5 years ago

G-Rath commented 5 years ago

Got this while closing the hello-world R project from Exercism:

java.lang.AssertionError: Already disposed: Project (Disposed) hello-world
    at com.intellij.openapi.components.impl.ComponentManagerImpl.lambda$throwAlreadyDisposed$1(ComponentManagerImpl.java:245)
    at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:53)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:970)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
    at com.intellij.openapi.application.ReadAction.run(ReadAction.java:53)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.throwAlreadyDisposed(ComponentManagerImpl.java:243)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.getPicoContainer(ComponentManagerImpl.java:236)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.getPicoContainer(ComponentManagerImpl.java:46)
    at com.intellij.openapi.components.ServiceManager.doGetService(ServiceManager.java:47)
    at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:30)
    at com.intellij.execution.ui.RunContentManager.getInstance(RunContentManager.java:31)
    at com.intellij.execution.impl.ExecutionManagerImpl.getContentManager(ExecutionManagerImpl.java:233)
    at com.r4intellij.intentions.InstallLibraryFix$1$1$1.run(InstallLibraryFix.java:107)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1054)
    at com.r4intellij.intentions.InstallLibraryFix$1$1.run(InstallLibraryFix.java:103)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:747)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:696)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:391)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

IntelliJ IDEA 2019.1 (Ultimate Edition) Build #IU-191.6183.87, built on March 27, 2019 Licensed to Gareth Jones Subscription is active until June 22, 2019 JRE: 1.8.0_202-release-1483-b39 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0

holgerbrandl commented 5 years ago

Is it a reproducible issue? disposed exceptions seem to happen for different plugins sporadically. Not an excuse for sure. :-)

G-Rath commented 5 years ago

Why was this issue closed? Did you manage to fix the issue?

holgerbrandl commented 5 years ago

I did not mean to disrespect your bug report. I've closed it because it's extremely hard to reproduce. Or can you do so in a systematic way? If so, feel welcome to reopen it.

G-Rath commented 5 years ago

That's ok - usually I'd have kept the issue open while I attempt reproduce it, so that it gets visibility for other users looking at the open issues, and then close it once it goes stale (say, after a couple of days)

Also, I can't re-open it 😕

As it happens weirdly I can't see to reproduce it now. I'll have a play around, and see if I can trigger it again.

Is there anywhere in the code that could throw this error (such as a call to project.dispose)?

holgerbrandl commented 5 years ago

Indeed that's better practice.

We never call dispose intentionally. It's called internally by the platform.