Skip to content
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

IllegalAccessError when modifying a class extending JpaRepository #633

Open
Artur- opened this issue Jan 20, 2025 · 3 comments
Open

IllegalAccessError when modifying a class extending JpaRepository #633

Artur- opened this issue Jan 20, 2025 · 3 comments

Comments

@Artur-
Copy link
Contributor

Artur- commented Jan 20, 2025

Exception in thread "Thread-4636" java.lang.NoClassDefFoundError: Could not initialize class org.hotswap.agent.plugin.proxy.java.ProxyGenerator
        at org.hotswap.agent.plugin.proxy.ReloadJavaProxyCommand.executeSingleCommand(ReloadJavaProxyCommand.java:68)
        at org.hotswap.agent.plugin.proxy.ReloadJavaProxyCommand.executeCommand(ReloadJavaProxyCommand.java:52)
        at org.hotswap.agent.command.impl.CommandExecutor.run(CommandExecutor.java:43)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalAccessError: class org.hotswap.agent.plugin.proxy.java.ProxyGenerator (in unnamed module @0x22ef9844) cannot access class sun.security.action.GetBooleanAction (in module java.base) because module java.base does not export sun.security.action to unnamed module @0x22ef9844 [in thread "Thread-4620"]
        at org.hotswap.agent.plugin.proxy.java.ProxyGenerator.<clinit>(ProxyGenerator.java:317)
        ... 3 more

Where should this add-opens be defined when running hotswap agent by copying it into JBR/lib/hotswap?

@skybber
Copy link
Contributor

skybber commented Jan 20, 2025

It must be in JVM arguments, in run configuration. I'll add it to JBR startup if -XX:HotswapAgent is used. This option currently automatically turns on:

java.base/java.lang=ALL-UNNAMED
java.base/jdk.internal.loader=ALL-UNNAMED
java.base/java.io=ALL-UNNAMED
java.desktop/java.beans=ALL-UNNAMED
java.desktop/com.sun.beans=ALL-UNNAMED
java.desktop/com.sun.beans.introspect=ALL-UNNAMED
java.desktop/com.sun.beans.util=ALL-UNNAMED

@skybber
Copy link
Contributor

skybber commented Jan 26, 2025

Did you try additional --add-opens on start?

@Artur-
Copy link
Contributor Author

Artur- commented Jan 26, 2025

Yes, that resolves it but hopefully jbr can add it automatically

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