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

dom4j dependency needs to be updated to 2.x to run on Java 11+ #5038

Closed
smalers opened this issue Mar 25, 2024 · 2 comments
Closed

dom4j dependency needs to be updated to 2.x to run on Java 11+ #5038

smalers opened this issue Mar 25, 2024 · 2 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@smalers
Copy link

smalers commented Mar 25, 2024

Describe the bug

I have developed an application on Java 8 using the AWS SDK (pom has version 2.18.19 for the software.amazon.awssdk bom). It is then deployed on Windows and Linux systems that run Java 8, 11, etc. Recently, a change in how the AWS SDK is being used in my code (new feature, etc.) has caused the following exception:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.dom4j.io.SAXContentHandler (file:/opt/tstool-14.9.3/bin/dom4j-1.6.1.jar) to method com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy.getEncoding()
WARNING: Please consider reporting this to the maintainers of org.dom4j.io.SAXContentHandler
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Expected Behavior

The parsing of JSON web service responses should work with no problems.

Current Behavior

The illegal reflective access error is generated, which prevents the AWS SDK from working correctly.

Reproduction Steps

I'm not sure of the exact trigger, but I am using the S3 and CloudFront AWS APIs. It works fine on Java 8 with dom4j-1.6.1 but running on Java 11 causes the problem.

Possible Solution

I do not know exactly what is triggering this issue, but internet research indicates that the fix is to use dom4j-2.1.4.jar (or similar), which supports Java 11. I have not tried running on Java versions newer than 11. I downloaded the dom4j-2.1.4.jar file from Maven Central and replaced the 1.6.1 version that Maven includes in the installation. This fixed the problem so I am moving on. I'll try to figure out if I can modify the pom to use the newer version of the file and override what AWS SDK pulls in. If the AWS SDK pom dependency is updated then I won't have to do the work-around.

Additional Information/Context

The software that I am using is complex so it is difficult to provide a snippet. See the AWS plugin code.

AWS Java SDK version used

2.18.19

JDK version used

OpenJDK 8 and 11

Operating System and version

Windows (latest) and Linux Debian Bullseye.

@smalers
Copy link
Author

smalers commented Mar 25, 2024

My bad on this. It appears that dom4j is coming in from another package, not AWS SDK. I'm closing this.

@smalers smalers closed this as completed Mar 25, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant