<Swing Dev> Another incarnation of the EventQueue NPE

Petr Pchelko petr.pchelko at oracle.com
Thu Feb 20 19:20:27 UTC 2014


Hello, Holger.

Thank you for the report.

The reason is that the ThreadPool is creating a thread in a ThreadGroup which is not associated with any AppContext. 
I suppose that the fix for JDK-8019274 would also resolve this issue, but this should be checked. I’ll write back as I have a chance to check this.

With best regards. Petr.

20 февр. 2014 г., в 11:01 после полудня, Holger Brands <holger.brands at googlemail.com> написал(а):

> Hi there,
> 
> this is meant as a comment to issue
> https://bugs.openjdk.java.net/browse/JDK-8019274
> which describes a problem of RMI threads calling out to java.awt.EventQueue in a java webstart app.
> 
> I think it's a more general problem, not only related to RMI threads. Another scenario is the following:
> When you open a JFileChooser in a Java Webstart application, change the
> view to "Details" such that column headers appear and then click on the name column to sort the shown entries, I get the
> following exception on Windows 7, both with Java 7u45 and Java 7u51:
> 
> java.lang.NullPointerException
>      at sun.awt.SunToolkit.getSystemEventQueueImplPP(Unknown Source)
>      at sun.awt.SunToolkit.getSystemEventQueueImplPP(Unknown Source)
>      at sun.awt.SunToolkit.getSystemEventQueueImpl(Unknown Source)
>      at java.awt.Toolkit.getEventQueue(Unknown Source)
>      at java.awt.EventQueue.isDispatchThread(Unknown Source)
>      at javax.swing.SwingUtilities.isEventDispatchThread(Unknown Source)
>      at javax.swing.JComponent.revalidate(Unknown Source)
>      at javax.swing.JTable.resizeAndRepaint(Unknown Source)
>      at javax.swing.JTable.sortedTableChanged(Unknown Source)
>      at javax.swing.JTable.sorterChanged(Unknown Source)
>      at javax.swing.RowSorter.fireRowSorterChanged(Unknown Source)
>      at javax.swing.RowSorter.fireRowSorterChanged(Unknown Source)
>      at javax.swing.DefaultRowSorter.sort(Unknown Source)
>      at sun.swing.FilePane$DetailsTableRowSorter.access$1601(Unknown Source)
>      at sun.swing.FilePane$DetailsTableRowSorter$1.call(Unknown Source)
>      at sun.swing.FilePane$DetailsTableRowSorter$1.call(Unknown Source)
>      at java.util.concurrent.FutureTask.run(Unknown Source)
>      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>      at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Unknown Source)
>      at java.lang.Thread.run(Unknown Source)
> 
> It's a similiar stacktrace but not quite the same.
> But I bet it's the same cause.
> 
> Please ensure when fixing JDK-8019274 that this variant is also fixed.
> Also, I would be interested in a workaround for this FileChooser sorting issue.
> 
> Thanks,
> Holger

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20140220/6e7838f3/attachment.html>


More information about the swing-dev mailing list