Troubleshooting

Reflection Permission Denied

You get a runtime error that says you do not have permission to perform a requested Reflection operation.

Reflection often includes requests that conflict with the access restrictions assigned to a class and its members. If you need to perform Reflection that is not by default granted by the SecurityManager, you need to explicitly grant the appropriate permission. This is typically done by adding the following entry to the associated policy file, which is the means used within the Java security architecture to specify the security policy in effect at runtime:

permission java.lang.reflect.ReflectPermission "suppressAccessChecks";

The default policy is determined by the java.policy file in the lib\ ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.