Permissions required to create charts with JFreeChart
I'd like to use JFreeChart to create charts from code running under a security manager. This fails with the error message
java.lang.InternalError: Can't connect to window server - not enough permissions.
If I change my policy file to give the code unrestricted permissions, it works fine开发者_StackOverflow, so the error must be due to some permission missing in my policy. But which one? I tried various AWT-related permissions but nothing seems to work. Is there a way to find out which permissions are missing?
When you start the app , add the following to the jvm arguments - it produces a huge amount of output, but it will point you in the right direction when there are permissions failures.
-Djava.security.debug=access,failure
精彩评论