-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Do not warn if sun.reflect.Reflection.getCallerClass() is unavailable #1760
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log4j-api
artifact is a multi-release JAR, so the code in your PR should only run if you are running on JRE 8. On JRE 9+ this class should run.
The typical reason why the Java 8 StackLocator
runs on JRE 9+ is shading: a user copies the classes from log4j-api
, but is not aware of other setting of the JAR (like the Multi-Release: true
entry in the manifest).
log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java
Outdated
Show resolved
Hide resolved
Thanks for your reply, much appreciated. :)
That it probably what happened for me. I am using the mill build tool for Scala, which is using Jar Jar Abrams for shading. Probably the shading does not support multi release jars. BTW, see also #1761. Note that I like you suggestions, but I will probably not have the resources to implement them. |
be5dc5a
to
39ec672
Compare
Modern Java releases disallow the access to internal sun.* API. There is not much the user can do about it, hence this warning is not actionable and therefore unneeded. It also does not tag its origin, causing confusion among users about its whereabouts.
39ec672
to
c9ef469
Compare
@Flowdalic, thank so much for the report and the PR, much appreciated! 🙇 Merging it... |
This is a follow up from my pervious PR [1]. Unfortunatly, it only occured to me after it was merged that the warning message is incomplete. In my case it was not the runtime environment which did not support multi-release JARs, but the build system. This adjusts the message accordingly. 1: apache#1760
Thanks for working on an improved solution and merging this. Unfortunately, I only discovered now that the commit message is incomplete and may blames the wrong entity for missing multi-release JAR support. See my follow up PR at #1833 |
Co-authored-by: Piotr P. Karwasz <piotr.github@karwasz.org> Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
Co-authored-by: Piotr P. Karwasz <piotr.github@karwasz.org> Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
Modern Java releases disallow the access to internal sun.* API. There is not much the user can do about it, hence this warning is not actionable and therefore unneeded.
It also does not tag its origin, causing confusion among users about its whereabouts.