Skip to main content

JFileChooser on Windows (XP SP3)

3 replies [Last post]
alexlamsl
Offline
Joined: 2004-09-02
Points: 0

Just wondering if the following problem has been known already - it happens once in a while when a JFileChooser instance is closed (discarded?)

Reproducible on both JavaSE 6uN and 6u6.

<br />
java.util.concurrent.RejectedExecutionException<br />
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1759)<br />
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)<br />
        at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)<br />
        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:92)<br />
        at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:493)<br />
        at sun.awt.shell.Win32ShellFolder2$FolderDisposer.dispose(Win32ShellFolder2.java:170)<br />
        at sun.java2d.Disposer.run(Disposer.java:128)<br />
        at java.lang.Thread.run(Thread.java:619)<br />
java.util.concurrent.RejectedExecutionException<br />
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1759)<br />
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)<br />
        at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)<br />
        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:92)<br />
        at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:493)<br />
        at sun.awt.shell.Win32ShellFolder2$FolderDisposer.dispose(Win32ShellFolder2.java:170)<br />
        at sun.java2d.Disposer.run(Disposer.java:128)<br />
        at java.lang.Thread.run(Thread.java:619)<br />

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexlamsl
Offline
Joined: 2004-09-02
Points: 0

Another note - I have submitted a bug report since the JVM crashes occasionally upon applicatoin exit (Review ID: 1269732). Just in case if they are related.

rogyeu
Offline
Joined: 2006-07-30
Points: 0

Could you please provide more information regarding your issue? Do you see the exception when you close the application, using short cut, or by doing something else? Can you provide a test case to reproduce this issue?

Here's a list for issues related to JFileChooser and RejectedExecutionException:
http://tinyurl.com/6eyuzf

Thanks,
Roger Y.

Replaced the original link (too long) w/ tinyurl.

Message was edited by: rogyeu

alexlamsl
Offline
Joined: 2004-09-02
Points: 0

Wow I did not expect that (read: I should have done this search myself before making assumptions...)

So here's what I did. I have a JFrame with a JButton which, when clicked, shows a JFileChooser (open).

Since I'm reusing the JFileChooser instance and that the JButton is the default button on the JFrame, if I hit Enter key (which brings up the JFileChooser again) twice (which hits the "open" button in the dialog) I can repeat the open action.

So what I did was holding down the Enter key - and after a few flicks I get a blank dialog and the exception. When I close the blank dialog, I discover a second one hiding beneath it with all the correct Components in the right place - except that none of them are responding, apart from the X close button on the title bar.

I will try the program on another machine and see if it is reproducible as well. One thing about the open action in the application I've tested that might worth noting - it spawns a new Process, read through its InputStream and do a waitFor() before continuing with execution.