<AWT Dev> AWT windows cannot be opened on Mavericks if screensaver is active

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Tue Mar 18 11:55:48 UTC 2014

Hi, Thorsten.
It seems that this is a known issue: 
Current plan is to fix it in jdk 9 and backport it to 8u20.

On 18.03.2014 14:08, Thorsten Meinl wrote:
> Hi,
> I discovered a regression with the latest Mavericks update in MacOS X.
> We have an automated test system (Jenkins) that runs GUI tests on MacOS
> X. Since the update to Mavericks they don't work any more but lead to
> exceptions such as
> java.lang.NullPointerException
> 	at java.awt.Window.initGC(Window.java:467)
> 	at java.awt.Window.init(Window.java:487)
> 	at java.awt.Window.<init>(Window.java:536)
> 	at java.awt.Frame.<init>(Frame.java:420)
> 	at java.awt.Frame.<init>(Frame.java:385)
> 	at javax.swing.JFrame.<init>(JFrame.java:180)
> This happens with the latest Java 1.7.0_51, Apple's old Java 6 is not
> affected by this problem!
> I investigated a bit further and found that this is caused by the
> screensaver. As soon as the screensaver starts, it's not possible to
> open AWT windows any more. I wrote a little program (see below) and
> executed it every five minutes. The first executions were fine but after
> about ~15 minutes (the display sleep timeout) it throws the above
> exceptions.
> Here is the program:
> public class Test {
>          public static void main(String[] args) {
>                  new javax.swing.JFrame().setVisible(true);
>                  System.exit(0);
>          }
> }
> Steps to reproduce: compile it, execute
> for ((i=0;i<20;i++)); do date; java test; sleep 300; done
> in a shell, leave the Mac alone, and check back after 30 minutes or so.
> It may be related to https://bugs.openjdk.java.net/browse/JDK-8036927,
> but in my case no display mirroring was involved.
> It may not be a critical problem for end users but it makes automated
> testing impossible (except if you turn of the screensaver completely).
> Regards,
> Thorsten

Best regards, Sergey.

More information about the awt-dev mailing list