JDK-8186432 : runtime error java.awt.IllegalComponentStateException thrown from multiple locations in application
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8u144
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2008
  • CPU: x86
  • Submitted: 2017-08-17
  • Updated: 2019-08-02
  • Resolved: 2017-08-18
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) Client VM (build 25.131-b11, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Windows server 2008 R2 Standard 64 bit
Windows Server 2012 R2 Standard 64 bit

EXTRA RELEVANT SYSTEM CONFIGURATION :
Running under remote desktop.

A DESCRIPTION OF THE PROBLEM :
program now generates a runtime error randomly throughout the entire application.  Sometimes it's on a .show method for a dialog box, other times it's seems to be reported entirely on it's own.  We routinely have 15 or 20 users actively running this application concurrently (we have a user base of 300+ user)and we get 3 or 4 of these errors per day.

This didn't coincide with any application changes. We are constantly keeping  our operating systems fully patched and update Java at least every other month.

REGRESSION.  Last worked in version 8u121

ADDITIONAL REGRESSION INFORMATION: 
Sorry, we installed the 131 version of java and uninstalled the previous version.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
That's a hard one.  It seems to be totally random.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The application should work with the exception happening
ACTUAL -
Execution error is caught by my uncaught exception handler:
        System.setProperty("sun.awt.exception.handler", AwtHandler.class.getName());

    public class AwtHandler {
        public void handle(Throwable t) {
            logRuntimeError(t);
            System.out.print(t.getStackTrace());
        }
    }


ERROR MESSAGES/STACK TRACES THAT OCCUR :
Here are a couple of tracelogs that we get when the problem occurs:
t5112 (jPar): runtime error--java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location on Tue Aug 15 11:48:44 PDT 2017

component must be showing on the screen to determine its location

free memory: 173220768
alloc memory: 259588096
max memory: 518979584
total memory: 432612256

java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
	at java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
	at java.awt.Component.getLocationOnScreen(Unknown Source)
	at javax.swing.text.JTextComponent$InputMethodRequestsHandler.getTextLocation(Unknown Source)
	at sun.awt.im.InputMethodContext.getTextLocation(Unknown Source)
	at sun.awt.windows.WInputMethod$1.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)


----------------------------------------------------------------------------------
Heres a different one.  This one is related to a user click to bring up a form.  I've included the last line of code executed in the application.  (See EntityView.java line 483)

t0270 (jPar): runtime error--java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location on Thu Aug 17 11:04:17 PDT 2017

component must be showing on the screen to determine its location

free memory: 146229888
alloc memory: 259588096
max memory: 1556938752
total memory: 1443580544

java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
	at java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
	at java.awt.Component.getLocationOnScreen(Unknown Source)
	at javax.swing.text.JTextComponent$InputMethodRequestsHandler.getTextLocation(Unknown Source)
	at sun.awt.im.InputMethodContext.getTextLocation(Unknown Source)
	at sun.awt.windows.WInputMethod$1.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.WaitDispatchSupport$2.run(Unknown Source)
	at java.awt.WaitDispatchSupport$4.run(Unknown Source)
	at java.awt.WaitDispatchSupport$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(Unknown Source)
	at java.awt.Dialog.show(Unknown Source)
	at java.awt.Component.show(Unknown Source)
	at java.awt.Component.setVisible(Unknown Source)
	at java.awt.Window.setVisible(Unknown Source)
	at java.awt.Dialog.setVisible(Unknown Source)
	at ca.specialtysoftware.jpar.client.view.EntityView.setVisible(EntityView.java:483)
(
            window.setVisible(visible);
)
	at ca.specialtysoftware.jpar.client.view.EntityView.start(EntityView.java:506)
	at ca.specialtysoftware.jpar.client.DefaultController.start(DefaultController.java:514)
	at ca.specialtysoftware.jpar.client.DefaultController.start(DefaultController.java:510)
	at ca.specialtysoftware.jpar.client.MainMenu$ListsListener.actionPerformed(MainMenu.java:3076)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.AbstractButton.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)


REPRODUCIBILITY :
This bug can be reproduced often.

---------- BEGIN SOURCE ----------
Have not been able to create a reliable test application.  Not even sure where to start  building one.  Our application is over 100,000 lines of code and the error happens randomly everywhere. Plus you can do the same function over and over hundreds of times, but sometimes it fails.
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
I'm wrapping some of the .setVisible calls in a try catch block in order to see if the program will continue to work even though it encountered this exception. However as you  can see from the stacktrace, some of the errors occur without any discernible location in the application.


Comments
Closing this as a duplicate of JDK-8179665.
18-08-2017