Changes Bar Exception

Got this when opening an existing project - I tried to 'Blame Changes Bar', but got repeated socket timeouts.

Already disposed
java.lang.AssertionError: Already disposed
at com.intellij.openapi.components.impl.ComponentManagerImpl.getComponent(ComponentManagerImpl.java:150)
at com.intellij.openapi.wm.ToolWindowManager.getInstance(ToolWindowManager.java:28)
at com.anecdote.ideaplugins.changesbar.ChangesBarProjectComponent.installCommentEditor(ChangesBarProjectComponent.java:234)
at com.anecdote.ideaplugins.changesbar.ChangesBarProjectComponent.stateChanged(ChangesBarProjectComponent.java:769)
at com.anecdote.ideaplugins.changesbar.ChangesBarProjectComponent$7.run(ChangesBarProjectComponent.java:226)
at com.intellij.openapi.wm.impl.commands.InvokeLaterCmd.run(InvokeLaterCmd.java)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:8)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:57)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:141)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:98)
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)

12 comments
Comment actions Permalink

Hi Dave... I'm trying to work out what causes this bug, but finding it
hard to repro...

Can you tell me if you were trying to open the project in the same frame
or a new one?

Also... Do you still have the console available for the IDEA instance
where you saw the exception? If so can you tell me what was written in
the console just before the exception happened? It should be
"Installing Commit Comment Editor in Changes Toolwindow for Project XXX"
and I need to know whether XXX is the project you were opening or
closing. Also are there any more lines saying the same thing for the
same project?

Thanks for any help you can give.

Cheers,
N.

Dave Lorde wrote:

Got this when opening an existing project - I tried to 'Blame Changes Bar', but got repeated socket timeouts.

Already disposed
java.lang.AssertionError: Already disposed
at com.intellij.openapi.components.impl.ComponentManagerImpl.getComponent(ComponentManagerImpl.java:150)
at com.intellij.openapi.wm.ToolWindowManager.getInstance(ToolWindowManager.java:28)
at com.anecdote.ideaplugins.changesbar.ChangesBarProjectComponent.installCommentEditor(ChangesBarProjectComponent.java:234)
at com.anecdote.ideaplugins.changesbar.ChangesBarProjectComponent.stateChanged(ChangesBarProjectComponent.java:769)
at com.anecdote.ideaplugins.changesbar.ChangesBarProjectComponent$7.run(ChangesBarProjectComponent.java:226)
at com.intellij.openapi.wm.impl.commands.InvokeLaterCmd.run(InvokeLaterCmd.java)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:8)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:57)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:141)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:98)
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)

0
Comment actions Permalink

Hello Nathan,

Hi Dave... I'm trying to work out what causes this bug, but finding it
hard to repro...


Don't bother with repro. :) Any time you call any code that accesses any
project components through invokeLater(), you need to check project.isDisposed()
as the first thing in the runnable you call through invokeLater().

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Hi Dmitry,

Yes, I thought of this as a solution to the problem but I wanted to
understand exactly why the problem occurs instead of just 'covering it
up' in this way.

As I understand it it seems that sometimes when opening a project,
projectOpened() is called on one of the ChangesBarProjectComponent
instances that exist (don't know whether it's the one for the opening
project or the existing project) but by the time the runnable is invoked
the project it corresponds to has been disposed.

Why would this happen? If it is the existing project and you are
replacing it with the new project then I can understand the old one
being disposed, but in this case why is projectOpened() called on the
closing project?

And if it is the new project that is being opened, why is it disposed at
the point when the runnable is invoked?

Questions questions :)

Cheers,
N.

Dmitry Jemerov wrote:

Hello Nathan,

>> Hi Dave... I'm trying to work out what causes this bug, but finding it
>> hard to repro...


Don't bother with repro. :) Any time you call any code that accesses any
project components through invokeLater(), you need to check
project.isDisposed() as the first thing in the runnable you call through
invokeLater().

0
Comment actions Permalink

Hello Nathan,

Yes, I thought of this as a solution to the problem but I wanted to
understand exactly why the problem occurs instead of just 'covering it
up' in this way.

As I understand it it seems that sometimes when opening a project,
projectOpened() is called on one of the ChangesBarProjectComponent
instances that exist (don't know whether it's the one for the opening
project or the existing project) but by the time the runnable is
invoked the project it corresponds to has been disposed.


It's of course for the opening project: every project component is strictly
linked to a project and they never mix up.

Why would this happen? If it is the existing project and you are
replacing it with the new project then I can understand the old one
being disposed, but in this case why is projectOpened() called on the
closing project?

And if it is the new project that is being opened, why is it disposed
at the point when the runnable is invoked?


One easy way for this to happen is canceling the project load.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Ah ok. I shall just check for disposed then. Thanks for the help!

Cheers,
N.

Dmitry Jemerov wrote:

Hello Nathan,

>> Yes, I thought of this as a solution to the problem but I wanted to
>> understand exactly why the problem occurs instead of just 'covering it
>> up' in this way.
>>
>> As I understand it it seems that sometimes when opening a project,
>> projectOpened() is called on one of the ChangesBarProjectComponent
>> instances that exist (don't know whether it's the one for the opening
>> project or the existing project) but by the time the runnable is
>> invoked the project it corresponds to has been disposed.


It's of course for the opening project: every project component is
strictly linked to a project and they never mix up.

>> Why would this happen? If it is the existing project and you are
>> replacing it with the new project then I can understand the old one
>> being disposed, but in this case why is projectOpened() called on the
>> closing project?
>>
>> And if it is the new project that is being opened, why is it disposed
>> at the point when the runnable is invoked?


One easy way for this to happen is canceling the project load.

0
Comment actions Permalink

Sorry Nathan, things have been a bit hectic, and I'm afraid I don't have any more details. If it happens again, I'll try and copy everything I can.

I did have two projects open at one point, but I can't say for sure the error happened then. I have noticed some small oddities when opening two projects, such as the first project window coming to the front and taking focus away from the second as it opens, and a dialog box opening in one project freezing the second (inappropriate modality?).

I've also been getting CVS annoyances on opening projects, like files I haven't touched flagged as modified, which diff says are identical, and I can only clear by checking out and overwriting...

Message was edited by:
Dave Lorde

0
Comment actions Permalink

Hi Dave,

Please try 1.5.2, just released. Hopefully it should fix this.

Cheers,
N.

Dave Lorde wrote:

Got this when opening an existing project - I tried to 'Blame Changes Bar', but got repeated socket timeouts.

Already disposed
java.lang.AssertionError: Already disposed
at com.intellij.openapi.components.impl.ComponentManagerImpl.getComponent(ComponentManagerImpl.java:150)
at com.intellij.openapi.wm.ToolWindowManager.getInstance(ToolWindowManager.java:28)
at com.anecdote.ideaplugins.changesbar.ChangesBarProjectComponent.installCommentEditor(ChangesBarProjectComponent.java:234)
at com.anecdote.ideaplugins.changesbar.ChangesBarProjectComponent.stateChanged(ChangesBarProjectComponent.java:769)
at com.anecdote.ideaplugins.changesbar.ChangesBarProjectComponent$7.run(ChangesBarProjectComponent.java:226)
at com.intellij.openapi.wm.impl.commands.InvokeLaterCmd.run(InvokeLaterCmd.java)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:8)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:57)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:141)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:98)
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)

0
Comment actions Permalink

Hi Nathan,

Er, I didn't actually have the 'Changes Bar' plugin installed, it was the default Changes panel that gave me the error and 'Blame Changes Bar' message dialog...

If the default Changes panel is actually the Changes Bar plugin, shouldn't it show up in the Installed Plugins list? If it isn't, why does it want to blame the 'Changes Bar'?

I'm confused, but I will install the latest Changes Bar plugin anyway :)

If it does it again -+ I'll be back+...

0
Comment actions Permalink

Hi Dave,

If you look down the stacktrace you'll see the reference to
'com.anecdote.ideaplugins.changesbar.ChangesBarProjectComponent' which
is most definitely only part of the Changes Bar plugin, so I guess you
must have installed it without realising/remembering!

The Changes panel is part of core Idea, Changes Bar adds a Changelist
selector to the status bar amongst other things (for projects with VCS
configured).

Thanks for trying it out anyway!

Cheers,
N.

Dave Lorde wrote:

Hi Nathan,

Er, I didn't actually have the 'Changes Bar' plugin installed, it was the default Changes panel that gave me the error and 'Blame Changes Bar' message dialog...

If the default Changes panel is actually the Changes Bar plugin, shouldn't it show up in the Installed Plugins list? If it isn't, why does it want to blame the 'Changes Bar'?

I'm confused, but I will install the latest Changes Bar plugin anyway :)

If it does it again -+ I'll be back+...

0
Comment actions Permalink

so I guess you must have installed it without realising/remembering!


That's what I thought when I saw your response, but when I looked in the Installed Plugins list it wasn't there. Then I went to the Available Plugins list and installed it from there - that's why I was confused...

Whatever, thanks for the help!

Dave

0
Comment actions Permalink

Hello Dmitry,

What's the difference is semantics between:
project.isDisposed()
!project.isInitialized()
!project.isOpen()

Thanks,

Taras


0
Comment actions Permalink

Hello Taras,

A project isOpen if it is in the list of open projects (i.e. it's not being
created in New Project Wizard, and not closed).
A project isDisposed if it is being closed now, or has been closed.
A project isInitialized if it is open, not disposed, and the startup activities
for it have been executed.

Clear enough? :)

What's the difference is semantics between:
project.isDisposed()
!project.isInitialized()
!project.isOpen()


--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.