Skip to content

AccessControlException: Access Denied - java.lang.reflect.ReflectPermission #953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
WeierE1 opened this issue Aug 13, 2024 · 2 comments
Open

Comments

@WeierE1
Copy link

WeierE1 commented Aug 13, 2024

Hi IcedTea-Web Support Team,

i get an AccessControlException: access denied ("java.lang.reflect.ReflectPermission" "suppressAccessChecks") when i start my application. In the JNLP file i set the security to all-permissions.

My JNLP Files looks like this

<?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.0+"> <information> <title>****</title> <vendor>****</vendor> <description>%project.description.long%</description> <description kind="short">%project.description.short%</description> <icon kind="shortcut" href="js/appIcon.png" width="64" height="64"/> <icon kind="splash" href="js/splashScreen.png"/> <shortcut online="true"> <desktop/> <menu submenu="****"/> </shortcut> <offline-allowed/> </information> <security> <all-permissions/> </security> <resources> <j2se version="21*" vendor="Eclipse Adoptium" java-vm-args="-Xmx3g -Xms1g"/> ..... </resources>

when running my application i got this error:
java.security.AccessControlException: access denied ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")
at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:488)
at java.base/java.security.AccessController.checkPermission(AccessController.java:1071)
at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:411)
at net.sourceforge.jnlp.runtime.JNLPSecurityManager.checkPermission(JNLPSecurityManager.java:272)
at java.base/java.lang.reflect.AccessibleObject.checkPermission(AccessibleObject.java:92)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:176)

can you please help me.

@WeierE1
Copy link
Author

WeierE1 commented Aug 15, 2024

Hi IcedTea-Web Support Team,

I figured out the following:
when the SecurityManager is enabled i get this AccessControlException: Access Denied also for other Permissions in the ForkJoinPool threads. If I disable the SecurityManager with -nosecurity everything works fine. Do you have an idea what has to be changed to make it work. I'm using openwebstart which is using Icedtew-Web

@andreiacsantos
Copy link

Hi Support Team,
I am having the same issue when using Java 17 from Oracle (it runs ok with Java 17 from Azul Zulu). Is there any way of adding the -nosecurity option to the itw-modularjdk.args or itweb-settings.exe? I cannot ask our clients to always run the application with the command line to use the -nosecurity option.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants