Printing Security System Trace Messages
By setting the system property java.security.debug to all,
the security system will print details of security related calls. The
value all prints all available debugging information. For finer
control of what is printed, see:
Here's an example of setting the system property on the command line:
Here's a sample of trace messages:
http://java.sun.com/j2se/1.4/docs/guide/plugin/developer_guide/debugger.html#jsdp
java -Djava.security.debug=all MyApp
access: access allowed (java.io.FilePermission c:\file1 read)
access: access allowed (java.io.FilePermission c:\file2 write)
access: access denied (java.util.PropertyPermission user.home read)
Exception in thread "main" java.security.AccessControlException: access denied (
java.util.PropertyPermission user.home read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1291)
at java.lang.System.getProperty(System.java:572)
at MyApp.main(MyApp.java:50)
Post a comment