简体   繁体   中英

Tracking down the source of java.security.AccessControlException

I have a Java applet which sometimes throws a java.security.AccessControlException whenever I call File.exists(). The problem goes away whenever I enclose the operation in an AccessController.doPrivileged() block. However, I can't figure out why. My applet is signed and should be fully trusted. In other scenarios, it can read/write to files without any problems.

Is there a way to walk up my calling stack and examine the effective permissions so that I can see who or what is trusted/untrusted?

You should enable java.security.debug property with access:stack first. It will help you understand what permission is lacking to the domain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM