JDK-4772834 : FileOpenService is completely broken with 3rd party look and feels
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 1.2.0
  • Priority: P2
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: linux
  • CPU: x86
  • Submitted: 2002-11-01
  • Updated: 2004-11-11
  • Resolved: 2004-11-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6Resolved
Description
Name: nt126004			Date: 11/01/2002


FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

FULL OPERATING SYSTEM VERSION :
Linux 2.4.18, glibc-2.2.5, Mandrake 8.2.
 
ADDITIONAL OPERATING SYSTEMS :


A DESCRIPTION OF THE PROBLEM :
There is no possible way of using FileOpenService.
Any combination of arguments to the FileOpenService
openFileDialog() method fail with access denied.

Yes. I have spent many hours on this since I submitted the bug report. I now 
know why it works for you and fails for me. What is broken is not only the 
FileOpenService, and FileSaveService, but potentially anything that triggers 
JWS to bring up a Security Dialog. Below is a more detailed explanation, 
along with some code samples you can use to reproduct the problem. Also 
included are similar Sun bug reports and why those fixes do not apply.

Username Dietz (is he one of the JWS developers?) in Sun's Java Web Start 
forums mentioned that when JWS brings up a Security dialog JWS starts up a 
separate AppContext. This may be the whole problem. Apparently JWS does this 
so no 3rd party look and feel could take control of the security dialog and 
automatically (or secretly) select "Yes". Pretty smart! However, the new 
AppContext may be running in a separate ClassLoader, or perhaps it is 
resetting the UIManager ClassLoader property to ensure the default Metal look 
and feel runs the security dialog and forgets to set the UIManager 
ClassLoader back. 

As you see from the exception, the 3rd party look and feel code is getting 
access violations because _I suspect_ it is running in the wrong ClassLoader.

I have tried many ways of setting the UIManager ClassLoader property, even 
forcing the UIDefaults properties to map the 3rd party registered 
UIComponents to class files instead of string names (so UIManager will not 
use Class.forName()) but this fails too.

Here is the code you need to reproduce the problem: Insert it before you use 
the FileOpenService

ClassLoader jwsClassLoader = this.getClass().getClassLoader();
UIManager.put("ClassLoader", jwsClassLoader);
SlafLookAndFeel slaf = new       
SlafLookAndFeel("com.memoire.slaf.SlafLookAndFeel");
UIManager.setLookAndFeel(slaf);

You can find slaf (any 3rd party look and feel will fail) at:
http://www.memoire.com/guillaume-desnoix/slaf/

I tried to set the UIDefault component mappings like this:
            // This doesn't work
            // http://www.gargoylesoftware.com/papers/bug12b4classloader.html
            Hashtable tb = UIManager.getDefaults();
            tb.put("ClassLoader", jwsClassLoader);
            Enumeration e = tb.keys();
            while (e.hasMoreElements()) {
                Object obj = e.nextElement();
                if (! (obj instanceof String))
                    continue;
                String k = (String)obj;
                if (k.endsWith("UI")) {
                    Class uic;
                    try {
                        uic = jwsClassLoader.loadClass(tb.get(k).toString());
                    } catch(Exception ex)  {
                        // classnotfound...
                        continue;
                    }
                    tb.put(uic.getName(), uic);
                }
            }

But it didn't work. I'm pretty sure it's because of the AppContext issue I 
described above. Likely someone familiar with the JWS internals and how it 
uses AppContext would be able to confirm this in 5 minutes.

Since this bug means no 3rd party look and feel can work reliably in JWS (if 
the FileOpenService/FileSaveService (others?)) are used I hope this bug can 
be made a high priority. 


REGRESSION.  Last worked in version 1.0.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Get the FileOpenService
2. call its openFileDialog() method.
3. Click 'Yes' to allow permission to the FileChooser
4. Watch the exception.


EXPECTED VERSUS ACTUAL BEHAVIOR :
I expected to be able to browser the hard drive. What
happened is the FileChooser gets access denied exceptions.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.security.AccessControlException: access denied (java.io.FilePermission /tmp
read)
    at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
at java.io.File.exists(File.java:677)
    at sun.awt.shell.ShellFolder.exists(ShellFolder.java:257)                       at
javax.swing.filechooser.FileSystemView.getSystemDisplayName(FileSystemVie
w.java:140)                                                                         at
javax.swing.plaf.basic.BasicFileChooserUI$BasicFileView.getName(BasicFile
ChooserUI.java:1005)                                                                at
javax.swing.JFileChooser.getName(JFileChooser.java:1437)
    at
javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxRenderer.getListCellRendererComponent(MetalFileChooserUI.java:1553)
    at
javax.swing.plaf.metal.MetalComboBoxButton.paintComponent(MetalComboBoxButton.java:150)
    at
com.incors.plaf.kunststoff.KunststoffComboBoxUI$MyMetalComboBoxButton.paintComponent(KunststoffComboBoxUI.java:60)
    at javax.swing.JComponent.paint(JComponent.java:808)                            at
javax.swing.JComponent.paintChildren(JComponent.java:647)
    at javax.swing.JComponent.paint(JComponent.java:817)                            at
javax.swing.JComponent.paintChildren(JComponent.java:647)
    at javax.swing.JComponent.paint(JComponent.java:817)                            at
javax.swing.JComponent.paintChildren(JComponent.java:647)
    at javax.swing.JComponent.paint(JComponent.java:817)                            at
javax.swing.JComponent.paintChildren(JComponent.java:647)
    at javax.swing.JComponent.paint(JComponent.java:817)                            at
javax.swing.JComponent.paintChildren(JComponent.java:647)
    at javax.swing.JComponent.paint(JComponent.java:817)                            at
javax.swing.JLayeredPane.paint(JLayeredPane.java:552)
    at javax.swing.JComponent.paintChildren(JComponent.java:647)                    at
javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4778)
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)
at javax.swing.JComponent.paint(JComponent.java:798)
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
    at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
at java.awt.Container.paint(Container.java:1309)
    at sun.awt.RepaintArea.paint(RepaintArea.java:177)                              at
sun.awt.motif.MComponentPeer.handleEvent(MComponentPeer.java:374)
    at java.awt.Component.dispatchEventImpl(Component.java:3658)                    at
java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)                          at
java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)                       at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread
.java:197)                                                                          at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.j
ava:150)                                                                            at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.j
ava:140)                                                                            at
java.awt.Dialog.show(Dialog.java:538)
    at javax.swing.JFileChooser.showDialog(JFileChooser.java:696)                   at
javax.swing.JFileChooser.showOpenDialog(JFileChooser.java:599)
    at com.sun.jnlp.FileOpenServiceImpl$1.run(FileOpenServiceImpl.java:93)
at java.security.AccessController.doPrivileged(Native Method)
    at
com.sun.jnlp.FileOpenServiceImpl.openFileDialog(FileOpenServiceImpl.java:73)
    at
com.wss.calendar.client.swing.InfoHTML.jButtonUpload_actionPerformed(InfoHTML.java:160)
    at com.wss.calendar.client.swing.InfoHTML$3.actionPerformed(InfoHTML.java:92)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)     at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractBu
tton.java:1817)                                                                     at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.jav
a:419)                                                                              at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5093)
    at java.awt.Component.processEvent(Component.java:4890)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
    at java.awt.Dialog.show(Dialog.java:538)
    at java.awt.Component.show(Component.java:1134)
    at java.awt.Component.setVisible(Component.java:1089)
    at
com.wss.calendar.client.swing.ScheduleWorldFrame.showInfoView(ScheduleWorldFrame.java:2139)
    at
com.wss.calendar.client.swing.ScheduleWorldFrame.jMenuItem14_actionPerformed(ScheduleWorldFrame.java:2124)
    at
com.wss.calendar.client.swing.ScheduleWorldFrame$47.actionPerformed(ScheduleWorldFrame.java:1088)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1109)
    at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
    at java.awt.Component.processMouseEvent(Component.java:5093)
    at java.awt.Component.processEvent(Component.java:4890)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
Exception occurred during event dispatching:
java.security.AccessControlException: access denied (java.io.FilePermission
/tmp/kde-mswanson read)
    at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
    at java.io.File.exists(File.java:677)
    at sun.awt.shell.ShellFolder.exists(ShellFolder.java:257)
    at
javax.swing.filechooser.FileSystemView.getSystemDisplayName(FileSystemView.java:140)
    at
javax.swing.plaf.basic.BasicFileChooserUI$BasicFileView.getName(BasicFileChooserUI.java:1005)
    at javax.swing.JFileChooser.getName(JFileChooser.java:1437)
    at
javax.swing.plaf.metal.MetalFileChooserUI$FileRenderer.getListCellRendererComponent(MetalFileChooserUI.java:1127)
    at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1147)
    at
javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1097)
    at javax.swing.plaf.basic.BasicListUI.paint(BasicListUI.java:162)
    at com.incors.plaf.kunststoff.KunststoffListUI.update(KunststoffListUI.java:72)
    at javax.swing.JComponent.paintComponent(JComponent.java:541)
    at javax.swing.JComponent.paint(JComponent.java:808)
    at javax.swing.JComponent.paintChildren(JComponent.java:647)
    at javax.swing.JComponent.paint(JComponent.java:817)
    at javax.swing.JViewport.paint(JViewport.java:707)
    at javax.swing.JComponent.paintChildren(JComponent.java:647)
    at javax.swing.JComponent.paint(JComponent.java:817)
    at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4771)
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)
    at javax.swing.JComponent._paintImmediately(JComponent.java:4668)
    at javax.swing.JComponent.paintImmediately(JComponent.java:4477)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
    at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
    at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.jav
###@###.### 10/4/04 19:21 GMT
a:140)
    at java.awt.Dialog.show(Dialog.java:538)
    at javax.swing.JFileChooser.showDialog(JFileChooser.java:696)
    at javax.swing.JFileChooser.showOpenDialog(JFileChooser.java:599)
    at com.sun.jnlp.FileOpenServiceImpl$1.run(FileOpenServiceImpl.java:93)
    at java.security.AccessController.doPrivileged(Native Method)
    at
com.sun.jnlp.FileOpenServiceImpl.openFileDialog(FileOpenServiceImpl.java:73)
    at
com.wss.calendar.client.swing.InfoHTML.jButtonUpload_actionPerformed(InfoHTML.java:160)
    at com.wss.calendar.client.swing.InfoHTML$3.actionPerformed(InfoHTML.java:92)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5093)
    at java.awt.Component.processEvent(Component.java:4890)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
    at java.awt.Dialog.show(Dialog.java:538)
    at java.awt.Component.show(Component.java:1134)
    at java.awt.Component.setVisible(Component.java:1089)
    at
com.wss.calendar.client.swing.ScheduleWorldFrame.showInfoView(ScheduleWorldFrame.java:2139)
    at
com.wss.calendar.client.swing.ScheduleWorldFrame.jMenuItem14_actionPerformed(ScheduleWorldFrame.java:2124)
    at
com.wss.calendar.client.swing.ScheduleWorldFrame$47.actionPerformed(ScheduleWorldFrame.java:1088)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1109)
    at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
    at java.awt.Component.processMouseEvent(Component.java:5093)
    at java.awt.Component.processEvent(Component.java:4890)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
Exception occurred during event dispatching:
java.security.AccessControlException: access denied (java.io.FilePermission
/tmp/kde-mswanson read)
    at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
    at java.io.File.exists(File.java:677)
    at sun.awt.shell.ShellFolder.exists(ShellFolder.java:257)
    at
javax.swing.filechooser.FileSystemView.getSystemDisplayName(FileSystemView.java:140)
    at
javax.swing.plaf.basic.BasicFileChooserUI$BasicFileView.getName(BasicFileChooserUI.java:1005)
    at javax.swing.JFileChooser.getName(JFileChooser.java:1437)
    at
javax.swing.plaf.metal.MetalFileChooserUI$FileRenderer.getListCellRendererComponent(MetalFileChooserUI.java:1127)
    at javax.swing.plaf.basic.BasicListUI.paintCell(BasicListUI.java:126)
    at com.incors.plaf.kunststoff.KunststoffListUI.paintCell(KunststoffListUI.java:86)
    at javax.swing.plaf.basic.BasicListUI.paint(BasicListUI.java:215)
    at com.incors.plaf.kunststoff.KunststoffListUI.update(KunststoffListUI.java:72)
    at javax.swing.JComponent.paintComponent(JComponent.java:541)
    at javax.swing.JComponent.paint(JComponent.java:808)
    at javax.swing.JComponent.paintChildren(JComponent.java:647)
    at javax.swing.JComponent.paint(JComponent.java:817)
    at javax.swing.JViewport.paint(JViewport.java:707)
    at javax.swing.JComponent.paintChildren(JComponent.java:647)
    at javax.swing.JComponent.paint(JComponent.java:817)
    at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4771)
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)
    at javax.swing.JComponent._paintImmediately(JComponent.java:4668)
    at javax.swing.JComponent.paintImmediately(JComponent.java:4477)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
    at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
    at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
    at java.awt.Dialog.show(Dialog.java:538)
    at javax.swing.JFileChooser.showDialog(JFileChooser.java:696)
    at javax.swing.JFileChooser.showOpenDialog(JFileChooser.java:599)
    at com.sun.jnlp.FileOpenServiceImpl$1.run(FileOpenServiceImpl.java:93)
    at java.security.AccessController.doPrivileged(Native Method)
    at
com.sun.jnlp.FileOpenServiceImpl.openFileDialog(FileOpenServiceImpl.java:73)
    at
com.wss.calendar.client.swing.InfoHTML.jButtonUpload_actionPerformed(InfoHTML.java:160)
    at com.wss.calendar.client.swing.InfoHTML$3.actionPerformed(InfoHTML.java:92)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5093)
    at java.awt.Component.processEvent(Component.java:4890)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
    at java.awt.Dialog.show(Dialog.java:538)
    at java.awt.Component.show(Component.java:1134)
    at java.awt.Component.setVisible(Component.java:1089)
    at
com.wss.calendar.client.swing.ScheduleWorldFrame.showInfoView(ScheduleWorldFrame.java:2139)
    at
com.wss.calendar.client.swing.ScheduleWorldFrame.jMenuItem14_actionPerformed(ScheduleWorldFrame.java:2124)
    at
com.wss.calendar.client.swing.ScheduleWorldFrame$47.actionPerformed(ScheduleWorldFrame.java:1088)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1109)
    at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
    at java.awt.Component.processMouseEvent(Component.java:5093)
    at java.awt.Component.processEvent(Component.java:4890)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
String pathHint = null; // for now
        //String[] extensions = { "jpg", "jpeg", "png" };
        String[] extensions = {};
        try {
            FileOpenService fos = jwsHelper.getFileOpenService();
            //FileContents[] fc = fos.openMultiFileDialog(pathHint, extensions);
            FileContents fc = fos.openFileDialog("/tmp", extensions);

---------- END SOURCE ----------

CUSTOMER WORKAROUND :
none exist
(Review ID: 166007) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b16
31-08-2004

WORK AROUND wrap the call to FileOpenService with code that saves, resets, and restores the look and feel: fss = (FileSaveService)ServiceManager.lookup("javax.jnlp.FileSaveService"); if (fss != null) { LookAndFeel oldLf = UIManager.getLookAndFeel(); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); fss.saveFileDialog( ... ); UIManager.setLookAndFeel(oldLF); }
31-08-2004

PUBLIC COMMENTS Custom look and feel in unsigned app causes exception in FileOpenService and FileSaveService.
31-08-2004

EVALUATION This will effect all sabdboxed apps, that insert there own look and feel, and then call any JNLP API function that within a doPriviliged block, show Dialogs or Windows. This will include: The FileOpenService, FileSaveService, PrintService (in the pageFormat dialog), and possibly the ClipboardService (though unsure). The problem is, we are in a doPriviliged block, giving our call (shch as the JFileChosser constructor in this example) full permissions, but when the salf plaf is invoked, the privilige is lost, so when it then calls back in to the BasicUI to (in this case) to get the systemDisplayName, the code no longer has full permissions, and throws an AccessControlException(). (It is a seperate bug that the error is neither displayed or cleanly reported) If a JFileChooser is constructed by the app, the same error occurs, which would be expected, as the app dosn't have file permsiision, but the FileOpenService API was invented to get around this, and should work even if a custom look and feel was set. To properly fix this we should run all priviliged code that might create Windows on the ThreadGroup of the Security AppContext. Not on the Applications AppContext. (as we do for SmartSecurityDialog()). We would have the same problem with _dummyDialog, since any of these calls may be done on the Applications EventQueueThread, and we would then need to create a secondary event q pump to display windo updates on the application's Windows till the modal dialog is complete. A simpilar solution is suggested by the work-around. We could wrap the dangerous calls with code that set the look and feel back to the default, and then restored it on returning. Dosn't look possible to fix this for mantis code freeze. committing to tiger. ###@###.### 2002-11-04 This was fixed in mustang for B14 as a side effect of the fix for: 5084842: Look and feel changes. ###@###.### 2004-11-08 21:32:49 GMT
04-11-2002