Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 268905 - IllegalStateException: Can't dispose InputContext while it's active
IllegalStateException: Can't dispose InputContext while it's active
Product: cnd
Classification: Unclassified
Component: Debugger
All All
: P3 (vote)
: 8.2
Assigned To: Maria Tishkova
EXCEPTIONS_REPORT, 82patch1-verified
Depends on:
  Show dependency treegraph
Reported: 2016-11-09 09:13 UTC by Vladimir Kvashin
Modified: 2016-12-13 09:48 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT

stacktrace (7.42 KB, text/plain)
2016-11-09 09:13 UTC, Vladimir Kvashin
The code of that throws the exception (40.56 KB, text/plain)
2016-11-09 10:06 UTC, Vladimir Kvashin

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2016-11-09 09:13:46 UTC
This issue was reported manually by vkvashin.
It already has 1 duplicates 

Build: NetBeans IDE 8.2 (Build 20161108-6cb00f1e6b8b)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.77-b03, Java(TM) SE Runtime Environment, 1.8.0_77-b03
OS: Linux

User Comments:
vkvashin: closed attach window

java.lang.IllegalStateException: Can't dispose InputContext while it's active
   at java.awt.Window$
   at java.awt.Window.doDispose(
   at java.awt.Dialog.doDispose(
   at java.awt.Window.dispose(
   at org.netbeans.modules.debugger.ui.actions.ConnectAction$ConnectListener.actionPerformed(
Comment 1 Vladimir Kvashin 2016-11-09 09:13:48 UTC
Created attachment 162841 [details]
Comment 2 Vladimir Kvashin 2016-11-09 09:31:50 UTC
This is 100% reproducible. In CND or full IDE, try attaching with gdb.
Modify "Filter" field.
Close the attach window.
Exception occurs.
Comment 3 Vladimir Kvashin 2016-11-09 10:06:30 UTC
Created attachment 162843 [details]
The code of that throws the exception
Comment 4 Vladimir Kvashin 2016-11-09 10:12:53 UTC
The code that throws exception is 

public synchronized void dispose() {
    if (currentClientComponent != null) {
        throw new IllegalStateException("Can't dispose InputContext while it's active");

Debugger shows that currentClientComponent is a text field. Its toString is 


I can 100% reproduce it on NB built from cnd-main with tip ecae8cddd8bb

It seems it does reproduce in release 8.2.
Comment 5 Vladimir Kvashin 2016-11-09 10:25:19 UTC
To reproduce, its enough just to change focus to "Filter" field. Then exception occurs. If you don't focus to the field, exception doesn't appear. If you change focus to the field, but then go to "Debugger" combo and reselect Gdb, exception does not happen (unless you focus the field after that)
Comment 6 Vladimir Kvashin 2016-11-10 11:02:15 UTC
I can not reproduce this, but if I set a breakpoint in
i.e. here 

    private boolean isPendingDelivery(DirEntry entry) {
        String name = entry.getName();
        if (name.startsWith("#") && name.endsWith("#")) { // NOI18N
>>>         name = name.substring(1, name.length() - 1);

and when it hits, I remove remote cache for this directory,
I see that the same stack fragment is entered again and so on.
Comment 7 Martin Entlicher 2016-11-10 12:33:11 UTC
"I ... recommend all users who face this exception to check their code for removeNotify() implementations."

This fixes the issue:
diff -r 264b33490767 cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/ui/processlist/
--- a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/ui/processlist/	Wed Nov 09 18:13:56 2016 +0000
+++ b/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/ui/processlist/	Thu Nov 10 14:32:51 2016 +0100
@@ -363,6 +363,7 @@
     public void removeNotify() {
+        super.removeNotify();
Comment 8 Maria Tishkova 2016-11-15 12:58:05 UTC
thanks to Martin. 
fixed in enum release82 branch (will be transplanted to the trunk this week later)

changeset:   313318:e97e8a86c8af
branch:      release82
user:        Maria Dalmatova <>
date:        Tue Nov 15 15:56:36 2016 +0300
summary:     fixed bz#268905 - IllegalStateException: Can't dispose InputContext while it's active
Comment 9 Quality Engineering 2016-11-23 03:19:08 UTC
Integrated into 'main-silver', will be available in build *201611230001* on (upload may still be in progress)

User: Maria Dalmatova <>
Log: fixed bz#268905 - IllegalStateException: Can't dispose InputContext while it's active
(transplanted from e97e8a86c8afa2ba49e08278e6a395765fbb9e10)
Comment 10 soldatov 2016-12-13 09:48:56 UTC
Verified in NetBeans IDE 8.2 (Build 201612122312)

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo