Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JFileChooser with Security Manger

843811May 6 2009 — edited May 7 2009
Hello,
I developed a swing application using JFileChooser. I'll recommend using the security manager and deliver a simple policy. The application works properly. But it throws an exception in XP:

Exception in thread "Basic L&F File Loading Thread" java.security.AccessControlE

xception: access denied (java.lang.RuntimePermission modifyThread)

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.checkAccess(Unknown Source)

at java.lang.Thread.checkAccess(Unknown Source)

at java.lang.Thread.interrupt(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerCancel(Unknown Source)

at java.util.concurrent.FutureTask.cancel(Unknown Source)

at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Unknown Sour

ce)

at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(Unkno

wn Source)

at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(Unknow

n Source)

It seems as if the JFileChooser does not really need this permission. So I will recommend to ignore it. Hackers would probably take it as an invitation.
Is this a bug?
In a small test project I can see that setting a file filter causes this problem.
I need a explanation for the users. Why does JFileChooser expect this permission?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2009
Added on May 6 2009
9 comments
319 views