Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6544857
Votes 41
Synopsis Regression:javax/swing/JFileChooser/4673161/bug4673161.java test fails and throws IOException.
Category java:classes_swing
Reported Against
Release Fixed 6u18(b04)
State 11-Closed, Verified, bug
Priority: 3-Medium
Related Bugs 6460525 , 6491795
Submit Date 11-APR-2007
Description
Bug Info:
=========
Test fails and throws IOException.It's failing from 6u2 b01 due to the fix 6491795 on windows.

It fails only on winxp professional and it's passing on winvista ultimate and winxp home.

JDK:
====
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b01)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

TestLocation:
=============
/net/sqindia.india/export/disk11/swing/updatereleasebinaries/6u2_b02_PIT/test/javax/swing/JFileChooser/4673161/bug4673161.java

Please find the attached log file for details.

Error log:
=========
----------System.err:(31/2310)----------
java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list
	at sun.awt.shell.Win32ShellFolder2$ComTask.execute(Win32ShellFolder2.java:1223)
	at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Win32ShellFolder2.java:557)
	at sun.awt.shell.Win32ShellFolderManager2.getRecent(Win32ShellFolderManager2.java:109)
	at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.java:248)
	at sun.awt.shell.ShellFolder.get(ShellFolder.java:218)
	at sun.swing.WindowsPlacesBar.<init>(WindowsPlacesBar.java:64)
	at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.updateUseShellFolder(WindowsFileChooserUI.java:508)
	at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponents(WindowsFileChooserUI.java:190)
	at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:136)
	at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(WindowsFileChooserUI.java:127)
	at javax.swing.JComponent.setUI(JComponent.java:673)
	at javax.swing.JFileChooser.updateUI(JFileChooser.java:1762)
	at javax.swing.JFileChooser.setup(JFileChooser.java:360)
	at javax.swing.JFileChooser.<init>(JFileChooser.java:333)
	at javax.swing.JFileChooser.<init>(JFileChooser.java:286)
	at bug4673161.init(bug4673161.java:28)
	at com.sun.javatest.regtest.AppletWrapper$AppletThread.run(AppletWrapper.java:144)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Could not get shell folder ID list
	at sun.awt.shell.Win32ShellFolder2.getFileSystemPath0(Native Method)
	at sun.awt.shell.Win32ShellFolder2.access$1000(Win32ShellFolder2.java:55)
	at sun.awt.shell.Win32ShellFolder2$8.call(Win32ShellFolder2.java:559)
	at sun.awt.shell.Win32ShellFolder2$8.call(Win32ShellFolder2.java:557)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at sun.awt.shell.Win32ShellFolder2$ComTaskExecutor$2.run(Win32ShellFolder2.java:1180)
	... 1 more
STATUS:Failed.Applet thread threw exception: java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list
result: Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list


test result: Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list
Posted Date : 2007-04-11 11:04:27.0
Work Around
N/A
Evaluation
The ComInvoker wraps any catched exceptions into RuntimeException, therefore the sun.awt.shell.Win32ShellFolder2#getFileSystemPath method doesn't throw IOException at all. As a result invokers of the getFileSystemPath method can't process the problem correctly and fail.

To avoid such situations the Invoker signature and implementation should be fixed.
Posted Date : 2009-10-15 15:53:26.0
Comments
  
  Include a link with my name & email   

Submitted On 11-JUL-2007
GregorK
We notice the same problem on Windows Vista with 1.6.0_02:

070710 13:34:33,0250(102) Error/GLOBAL:: Uncaught exception: java.io.IOException: Could not get shell folder ID list in Thread: AWT-EventQueue-0 - Exception: java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list
	at sun.awt.shell.Win32ShellFolder2$ComTask.execute(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Unknown Source)
	at sun.awt.shell.Win32ShellFolderManager2.getPersonal(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2$10.call(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2$10.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2$ComTaskExecutor$2.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Could not get shell folder ID list
	at sun.awt.shell.Win32ShellFolder2.getFileSystemPath0(Native Method)
	at sun.awt.shell.Win32ShellFolder2.access$1000(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2$8.call(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2$8.call(Unknown Source)
	... 11 more


Submitted On 11-SEP-2007
Same problem on Windows 2000

java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list
   sun.awt.shell.Win32ShellFolder2$ComTask.execute(Unknown Source)
   sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Unknown Source)
   sun.awt.shell.Win32ShellFolderManager2.getPersonal(Unknown Source)
   sun.awt.shell.Win32ShellFolder2$10.call(Unknown Source)
   sun.awt.shell.Win32ShellFolder2$10.call(Unknown Source)
   java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
   java.util.concurrent.FutureTask.run(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   sun.awt.shell.Win32ShellFolder2$ComTaskExecutor$2.run(Unknown Source)
   java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Could not get shell folder ID list
   sun.awt.shell.Win32ShellFolder2.getFileSystemPath0(Native Method)
   sun.awt.shell.Win32ShellFolder2.access$1000(Unknown Source)
   sun.awt.shell.Win32ShellFolder2$8.call(Unknown Source)
   sun.awt.shell.Win32ShellFolder2$8.call(Unknown Source)
   sun.awt.shell.Win32ShellFolder2$ComTask.execute(Unknown Source)
   sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Unknown Source)
   sun.awt.shell.Win32ShellFolderManager2.getPersonal(Unknown Source)
   sun.awt.shell.Win32ShellFolder2$10.call(Unknown Source)
   sun.awt.shell.Win32ShellFolder2$10.call(Unknown Source)
   java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
   java.util.concurrent.FutureTask.run(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   sun.awt.shell.Win32ShellFolder2$ComTaskExecutor$2.run(Unknown Source)
   java.lang.Thread.run(Unknown Source)


Submitted On 24-OCT-2007
Trying to save after disconnecting from network

RuntimeException {class java.lang.RuntimeException "java.io.IOException: Could not get shell folder ID list"
 at sun.awt.shell.Win32ShellFolder2$ComTask.execute(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Unknown Source)
 at sun.awt.shell.Win32ShellFolderManager2.getPersonal(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2$10.call(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2$10.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2$ComTaskExecutor$2.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source);
caused by class java.io.IOException "Could not get shell folder ID list"
 at sun.awt.shell.Win32ShellFolder2.getFileSystemPath0(Native Method)
 at sun.awt.shell.Win32ShellFolder2.access$1000(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2$8.call(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2$8.call(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2$ComTask.execute(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Unknown Source)
 at sun.awt.shell.Win32ShellFolderManager2.getPersonal(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2$10.call(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2$10.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at sun.awt.shell.Win32ShellFolder2$ComTaskExecutor$2.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)}


Submitted On 21-FEB-2008
ohumbel
The bug is still there, so I tried to write a workaround.
Please find it here:

http://jython.svn.sourceforge.net/viewvc/jython?view=rev&revision=4161


Submitted On 27-FEB-2008
Could the "FileChooser.useShellFolder" or "FileChooser.noPlacesBar" UIManager properties also be set to workaround this issue?


Submitted On 16-MAY-2008
opticyclic
I had the same problem on Windows Vista Ultimate with 1.5.0.14

You can workaround/fix this problem by modifying the registry.

The relevant key is:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

A couple of the Shell Folders ("Personal" and "My Pictures" in my case) had an absolute path to a drive that no longer existed.
The folders should be %USERPROFILE%\Pictures rather than absolute paths.



Submitted On 08-AUG-2008
TheAvalanche
I am rather sad to see that this bug is still not fixed.


Submitted On 24-SEP-2008
Same problem on XP Prof [5.1.2600]

record in registry "User Shell Folders" was OK - i.e. it is NOT general workaround.

It seems it happened always in all java applications using JFileChooser running on certain computers with XP prof. (with different hardware). Same code on other PCs runs well regardless of used JDK/JRE. Problem seems to be dependant on Windowns state/configuration & JDK version.

JDK which runs well
1.6.0
1.6.0_01

JDK which always failed
1.6.0_06
1.6.0_10 rc2 b32


Submitted On 10-OCT-2008
grima
There is a simple workaround:
Ensure that the next folder exists

"%HOMEDRIVE%%HOMEPATH%\Documents"

and all will work fine.


Submitted On 25-OCT-2008
XP Professional - SP3
jre1.6.0_07 dosen't work
jre1.5.0_16 works corectly

workaround folder "Documents" and similar ones cited on others forum no effect


Submitted On 17-DEC-2008
efj
We encounter this error on Windows XP SP3 / Windows 2000 SP4, both with java.version=1.6.0_11

java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list

	at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Unknown Source)

	at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Unknown Source)

	at sun.awt.shell.Win32ShellFolderManager2.getRecent(Unknown Source)

	at sun.awt.shell.Win32ShellFolderManager2.get(Unknown Source)

	at sun.awt.shell.ShellFolder.get(Unknown Source)

	at sun.swing.WindowsPlacesBar.<init>(Unknown Source)

	at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.updateUseShellFolder(Unknown Source)

	at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponents(Unknown Source)

	at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)

	at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(Unknown Source)

	at javax.swing.JComponent.setUI(Unknown Source)

	at javax.swing.JFileChooser.updateUI(Unknown Source)

	at javax.swing.JFileChooser.setup(Unknown Source)

	at javax.swing.JFileChooser.<init>(Unknown Source)

	at javax.swing.JFileChooser.<init>(Unknown Source)


Submitted On 11-FEB-2009
Ritesh_Narain
This issue has been outstanding for almost 2 years now. SaaS companies have very little control on getting such changes done on end user machines and hence it is very necssary for this to be resolved. Can we get an idea about ETA for a fix?


Submitted On 18-MAR-2009
Vista Ultimate, JDK/JRE 6.0.12;
- all shell folders are good (checked manually)
- bug is still here.


Submitted On 08-MAY-2009
todd.w
Problem still exists on Windows XP pro sp3 under jdk 1.6.0_13.

Verified all folders in: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

Unbelievable that this is still an open bug...  guess I'll be rolling back to java 5...



Submitted On 13-MAY-2009
I had this problem when using Netbeans 6.7 and tried  to verify the problem with a simple java class opening a JFileChooser.
The problem only arises when using the windows system L&F.

So I changed the Netbeans L6F with --laf com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel in netbeans.conf as described in http://blogs.sun.com/netbeansphp/entry/how_to_change_look_and .

Now another annoying problem went away: Sometimes the Netbeans editor could not find all classes from a package but just some of them for code completion and marked the lines with errors .

One interesting point stays: Netbeans 6.5(.1) seems to use the same L6F as 6.7 but there all works correctly, even with the same java version!

Greetings from Austria
 Peter


Submitted On 19-MAY-2009
I have this issue on Win64, using 1.6 U13. The aforementioned registry paths seem sane. 

I get the following exception when trying to construct a JFC:

java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list
	at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Unknown Source)
	at sun.awt.shell.Win32ShellFolderManager2.getPersonal(Unknown Source)
	at sun.awt.shell.Win32ShellFolderManager2.get(Unknown Source)
	at sun.awt.shell.ShellFolder.get(Unknown Source)
	at sun.swing.WindowsPlacesBar.<init>(Unknown Source)
	at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.updateUseShellFolder(Unknown Source)
	at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponents(Unknown Source)
	at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
	at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(Unknown Source)
	at javax.swing.JComponent.setUI(Unknown Source)
	at javax.swing.JFileChooser.updateUI(Unknown Source)
	at javax.swing.JFileChooser.setup(Unknown Source)
	at javax.swing.JFileChooser.<init>(Unknown Source)
	at javax.swing.JFileChooser.<init>(Unknown Source)
	at AuditFileParser.Interface.actionPerformed(Interface.java:60)
	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.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)
Caused by: java.io.IOException: Could not get shell folder ID list
	at sun.awt.shell.Win32ShellFolder2.getFileSystemPath0(Native Method)
	at sun.awt.shell.Win32ShellFolder2.access$900(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2$8.call(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2$8.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(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)


Submitted On 23-JUN-2009
jey123
Hi All,
Today I tried to reinstall NetBeans 6.5.1, I got the following JDK error on my Windows Vista Machine. Can anybody tell me how can I resolve this issue?

[2009-06-23 11:51:35.270]: 	at java.lang.Thread.run(Unknown Source)
[2009-06-23 11:51:35.270]: Caused by: java.io.IOException: Could not get shell folder ID list
[2009-06-23 11:51:35.270]: 	at sun.awt.shell.Win32ShellFolder2.getFileSystemPath0(Native Method)
[2009-06-23 11:51:35.270]: 	at sun.awt.shell.Win32ShellFolder2.access$900(Unknown Source)
[2009-06-23 11:51:35.270]: 	at sun.awt.shell.Win32ShellFolder2$8.call(Unknown Source)
[2009-06-23 11:51:35.270]: 	at sun.awt.shell.Win32ShellFolder2$8.call(Unknown Source)
[2009-06-23 11:51:35.270]: 	... 18 more
[2009-06-23 11:51:35.271]: ... show message dialog
[2009-06-23 11:51:35.271]:     title: Critical Error
[2009-06-23 11:51:35.271]:     message: An unexpected exception happened in thread AWT-EventQueue-0
[2009-06-23 11:51:35.271]:     
[2009-06-23 11:51:35.271]:     Exception:
[2009-06-23 11:51:35.272]:       java.lang.RuntimeException:
[2009-06-23 11:51:35.272]:       java.io.IOException: Could not get shell folder ID list
[2009-06-23 11:51:35.272]:     
[2009-06-23 11:51:35.272]:     You can get more details about the issue in the installer log file:
[2009-06-23 11:51:35.272]:      C:\Users\ssl_laa\.nbi\log\20090623115124.log
[2009-06-23 11:53:34.556]: ... dialog closed

Thanks,
Jey


Submitted On 02-JUL-2009
mrsteve
We successfully implemented a full workaround by:

- always extending JFileChooser, overriding setup(), and first thing, disabling shell folders using the client property "FileChooser.useShellFolder" before the first call to setUI

- before instantiating, using reflection to replace ShellFolder.shellFolderManager (by default Win32ShellFolderManager2) with a generic instance of ShellFolderManager itself.

Furthermore, we construct JFileChoosers in two attempts.  The first is without the above fix; if this fails, and the exception contains the text "ShellFolder" (etc.), we activate the above fixes and try again.

This means users without the problem see the proper file chooser; users with the problem see the Java 1.3 file chooser (with drive letters as roots) and no crashes.


Submitted On 19-SEP-2009
cpesch
The patch as suggested by http://jython.svn.sourceforge.net/viewvc/jython?view=rev&revision=4161 works fine for my http://www.routeconverter.de/ application.



PLEASE NOTE: JDK6 is formerly known as Project Mustang