-
Notifications
You must be signed in to change notification settings - Fork 159
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
WARNING: An illegal reflective access operation has occurred #2266
Comments
Thanks @rubberduck203 we're aware of the warning. It's related to the XML library which we is dependent upon uses Reflection to access the xml model in memory. |
Cool. Thanks @prb112. |
We are currently using the JVM default implementations of |
Just FYI, as of Java 17, this won't even compile anymore. |
The javadocs say that these system properties are the first things consulted. I think we shied away from relying on system properties for proper functionality in the past, but will Java 17 around the corner it would be nice to remove the reflection here before it breaks. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
In cases where fhir-model is used outside the server, many programs will need to set the javax.xml.stream properties to get the right behavior. This commit makes it so that, if these properties are NOT set, then we'll temporarilly set them to get the right factory for our model. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
* issue #2266 - avoid reflection while instantiating XML factories The javadocs say that these system properties are the first things consulted. I think we shied away from relying on system properties for proper functionality in the past, but will Java 17 around the corner it would be nice to remove the reflection here before it breaks. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * issue #2266 - use system properties to create the right factories In cases where fhir-model is used outside the server, many programs will need to set the javax.xml.stream properties to get the right behavior. This commit makes it so that, if these properties are NOT set, then we'll temporarilly set them to get the right factory for our model. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Confirmed with JDK 11 it no longer is reported. Test 1: Ran build with 4.9.1 and main
Confirmed the message exists on the tag, and not in the main. Test 2: Ran with Liberty on AdoptOpenJDK 11 with 4.9.1 and main Confirmed the message exists on tag and not in the main branch |
Describe the bug
Environment
Which version of IBM FHIR Server?
4.7.0
To Reproduce
Steps to reproduce the behavior:
I'm not entirely sure.
Would be happy to help reproduce it given some guidance.
I'm running OpenJDK 11 and it seems that this behavior was introduced in JDK 9.
If you're using an older JDK, you might not see this.
Expected behavior
A clear and concise description of what you expected to happen.
No warnings.
Additional context
Add any other context about the problem here.
This StackOverflow Q&A may help someone who understands the problem better than I.
https://stackoverflow.com/questions/50251798/what-is-an-illegal-reflective-access
The text was updated successfully, but these errors were encountered: