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

Add JVM-argument --add-opens to fix Reload Configurations classloading issue #86

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

jkosternl
Copy link
Contributor

@jkosternl jkosternl commented Mar 13, 2024

  1. Add JVM-argument --add-opens to fix Reload Configurations classloading issue
  2. ignore IntelliJ folder for Git

Fix 1 is needed if you click at Reload Configurations in the console. Without it, the -add-opens parameters are not correctly pass through the classloaders who are trying to load the classes in the Configurations used. The first load of configurations works fine, but reloads are failing with:
2024-03-13 10:52:02,045 ERROR [http-nio-80-exec-9] {} lifecycle.ApplicationMessageEvent - Application [MyFirstFrank] an exception occurred while loading configuration [IAF_Util] java.lang.NullPointerException: Cannot invoke "String.hashCode()" because "<local2>" is null

With the default examples inside frank-runner I did not get this reproduced. But with the Academy project ../MyFirstFrank it happened.
Adding this jvmargs fixes the below class loading issue and the previous strange NPE is gone as well.

Here is the used configuration (renamed, because GitHub refuses .xml files):
Configuration.xml.txt

Part of the stacktrace which is solved by this PR:

2024-03-13 10:52:02,016 ERROR [http-nio-80-exec-9] {} digester3.Digester - Begin event threw exception
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.frankframework.jdbc.XmlQuerySender': 
Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not 
generate CGLIB subclass of class org.frankframework.jdbc.XmlQuerySender: Common causes of this problem include 
using a final class or a non-visible class; nested exception is org.springframework.cglib.core.ReflectUtils$6:
 ClassLoader mismatch for [org.frankframework.jdbc.XmlQuerySender]: JVM should be started with 
--add-opens=java.base/java.lang=ALL-UNNAMED for ClassLoader.defineClass to be accessible on 
org.frankframework.configuration.classloaders.WebAppClassLoader; consider co-locating the affected class in that 
target ClassLoader instead.

…g issue

* Also ignore IntelliJ folder for Git
build.xml Outdated Show resolved Hide resolved
@jkosternl jkosternl requested a review from jacodg March 25, 2024 16:11
@jacodg jacodg merged commit 3761ce6 into master Mar 25, 2024
18 checks passed
@jacodg jacodg deleted the issue/fixReloadConfigs branch March 25, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Console: Reload Configurations leads to NPE "<local2>" is null
3 participants