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开发者_C百科 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.
精彩评论