Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7036025

java.security.AccessControlException when creating JFileChooser in signed applet

XMLWordPrintable

    • b142
    • x86
    • windows_xp
    • Verified

      FULL PRODUCT VERSION :
      1.6.0_24-b07

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP Professional SP3

      A DESCRIPTION OF THE PROBLEM :
      When creating a JFileChooser in a signed applet like so:

          SwingUtilities.invokeAndWait(new Runnable()
           {
                      public void run()
                      {
                           JFileChooser fileChooser = new JFileChooser();
                           ...
                      }
           )

      An exception is thrown and the JFileChooser is not launched.

      This problem does not occur in update 23.

      REGRESSION. Last worked in version 6

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Create JFileChooser as described above within a signed applet.
      2) Attempt to run the applet in a web page
      3) Notice JFileChooser does not come up
      4) Observe Java Console for stack trace

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      JFileChooser should launch
      ACTUAL -
      JFileChooser did not launch and stack trace was produced in Java Console

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      The following exception is thrown:

      java.security.AccessControlException: access denied (java.io.FilePermission C:\Documents and Settings\username\Recent read)
                      at java.security.AccessControlContext.checkPermission(Unknown Source)
                      at java.security.AccessController.checkPermission(Unknown Source)
                      at java.lang.SecurityManager.checkPermission(Unknown Source)
                      at java.lang.SecurityManager.checkRead(Unknown Source)
                      at java.io.File.exists(Unknown Source)
                      at java.io.Win32FileSystem.canonicalize(Unknown Source)
                      at java.io.File.getCanonicalPath(Unknown Source)
                      at sun.awt.shell.Win32ShellFolderManager2.createShellFolder(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)
                      at package.MyClass$1.run(MyClass.java:56)
                      at java.awt.event.InvocationEvent.dispatch(Unknown Source)
                      at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
                      at java.awt.EventQueue.access$000(Unknown Source)
                      at java.awt.EventQueue$1.run(Unknown Source)
                      at java.awt.EventQueue$1.run(Unknown Source)
                      at java.security.AccessController.doPrivileged(Native Method)
                      at java.security.AccessControlContext$1.doIntersectionPrivilege(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


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Use 1.6.0_23

            rupashka Pavel Porvatov (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: