Use privileged access where required when using a security manager. Check permissions in the Category for better error reporting.