Name: jk109818 Date: 06/16/2003
FULL PRODUCT VERSION :
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)
FULL OS VERSION :
Windows NT Version 4.0
A DESCRIPTION OF THE PROBLEM :
If the system policy prevents a user from accessing network neighbourhood any program that attempts to create a JFileChooser object will fail with the error -
Caused by: java.lang.InternalError: Could not bind shell folder to interface
at sun.awt.shell.Win32ShellFolder2.initSpecial(Native Method)
at sun.awt.shell.Win32ShellFolder2.<init>(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.getNetwork(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.compareShellFolders(Unknown So
urce)
at sun.awt.shell.Win32ShellFolder2.compareTo(Unknown Source)
at sun.awt.shell.ShellFolder.compareTo(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.get(Unknown Source)
at sun.awt.shell.ShellFolder.get(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponent
s(Unknown Source)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(Unknow
n 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)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set the policy for a user to prevent them from accessing the network neighbourhood. This will set the NoNetHood value under the following registry key to 1 -
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
With this value set to one run any java program that creates a JFileChooser. It should fail with the above error. Setting the value of the registry key to 0 will allow the JFileChooser to operate correctly.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The file chooser should open normally
ACTUAL -
The file chooser failed with the "Could not bind shell folder to interface"
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Caused by: java.lang.InternalError: Could not bind shell folder to interface
at sun.awt.shell.Win32ShellFolder2.initSpecial(Native Method)
at sun.awt.shell.Win32ShellFolder2.<init>(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.getNetwork(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.compareShellFolders(Unknown So
urce)
at sun.awt.shell.Win32ShellFolder2.compareTo(Unknown Source)
at sun.awt.shell.ShellFolder.compareTo(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.get(Unknown Source)
at sun.awt.shell.ShellFolder.get(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponent
s(Unknown Source)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(Unknow
n 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)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.JFileChooser;
public class TestFileChooser
{
public static void main(String args[])
{
JFileChooser fc = new JFileChooser();
fc.showOpenDialog(null);
}
}
---------- END SOURCE ----------
(Review ID: 188185)
======================================================================