[Solved] java.security.AccessControlException: Access Denied Error

Error Messages:

The following error occurs from an application client or in the server.log:
java.security.AccessControlException: access denied
(java.util.PropertyPermission name write…
There is a permissions issue in the policy files. Either the client.policy for the application client or the server.policy for server side components does not have permission to set the property.

 

Solution:
Add the permission in client.policy (for the application client), or in server.policy (for EJB/web modules) for the application that needs to set the property. By default, applications only have “read” permission for properties.
For example, to grant read/write permission for all the files in the codebase directory, add or append the following to client.policy or server.policy:

grant codeBase "file:/.../build/sparc_SunOS/sec/-" {
   permission java.util.PropertyPermission "*", "read,write";
 };

Reference Resources: https://docs.oracle.com/cd/E19830-01/819-4726/fxxzk/index.html

Go to the running $JAVA_HOME and look for the xx.policy file, and then make changes in the contents

find . -type f -name "*.policy"

Note: local operation does not have such a problem and the production has, then you can consider the production of the corresponding file was modified to affect the original program (consider restoring the configuration to determine what configuration is affected)

Read More: