-
Bug
-
Resolution: Duplicate
-
P2
-
6u10
-
x86
-
windows_xp
I am running a Swing applet that uses a JEditorPane and a FileChooser. I have given File read/write permission and user.dir permission. When the applet gets loaded, I am getting a security exception on the java console -
Exception in thread "Basic L&F File Loading Thread" java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at sun.applet.AppletSecurity.checkAccess(AppletSecurity.java:214)
at java.lang.Thread.checkAccess(Thread.java:1263)
at java.lang.Thread.interrupt(Thread.java:842)
at java.util.concurrent.FutureTask$Sync.innerCancel(FutureTask.java:290)
at java.util.concurrent.FutureTask.cancel(FutureTask.java:76)
at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:498)
at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(BasicDirectoryModel.java:221)
at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(BasicDirectoryModel.java:216)
I tried this with 6u10-b23, 24, 25 and the current b26 PIT build and it is reproducible with all of them. I reproduced it using IE7 on WinXP Prof. The same exception is also reproducible using AppletViewer. But this is not reproducible on jdk6-FCS. Hence it is a regression in 6u10. This would be confusing for the end user since this is not an expected permission for the FileChooser.
To reproduce the bug -
1. run the attached test using AppletViewer - AppletViewer JEditorPaneTest.html
2. While the applet is loading, click inside the empty applet viewer window a few times (it is actually reproducible even without this as well but I somehow feel it is quick when I do this)
3. You will see the above exception on the command prompt.
If you are using the browser, just open the JEditorPaneTest.html from the IE browser and you will see the above exception in the java console.
This is reproducible with SwingSet2 as well. Just run the SwingSet2 app with -Djava.security.manager and go to FileChooser demo. Try opening some of the file choosers and you will see the security exception on the console.
Exception in thread "Basic L&F File Loading Thread" java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at sun.applet.AppletSecurity.checkAccess(AppletSecurity.java:214)
at java.lang.Thread.checkAccess(Thread.java:1263)
at java.lang.Thread.interrupt(Thread.java:842)
at java.util.concurrent.FutureTask$Sync.innerCancel(FutureTask.java:290)
at java.util.concurrent.FutureTask.cancel(FutureTask.java:76)
at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:498)
at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(BasicDirectoryModel.java:221)
at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(BasicDirectoryModel.java:216)
I tried this with 6u10-b23, 24, 25 and the current b26 PIT build and it is reproducible with all of them. I reproduced it using IE7 on WinXP Prof. The same exception is also reproducible using AppletViewer. But this is not reproducible on jdk6-FCS. Hence it is a regression in 6u10. This would be confusing for the end user since this is not an expected permission for the FileChooser.
To reproduce the bug -
1. run the attached test using AppletViewer - AppletViewer JEditorPaneTest.html
2. While the applet is loading, click inside the empty applet viewer window a few times (it is actually reproducible even without this as well but I somehow feel it is quick when I do this)
3. You will see the above exception on the command prompt.
If you are using the browser, just open the JEditorPaneTest.html from the IE browser and you will see the above exception in the java console.
This is reproducible with SwingSet2 as well. Just run the SwingSet2 app with -Djava.security.manager and go to FileChooser demo. Try opening some of the file choosers and you will see the security exception on the console.