-
Notifications
You must be signed in to change notification settings - Fork 235
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
Illegal reflective access caused by xstream #655
Comments
This actually isn't related to XStream anyhow, that particular case is WebLaF using some proprietary stuff through Reflection to properly detect fonts for the UI. It is usually done by basic implementations of components/L&F, but since I rewritten a lot of that code - I have it on WebLaF's side and have to sometimes access proprietary stuff, not just for fonts. A few big examples of Reflection usage:
The warning you get is not a bug and it is expected on Java 9+. I don't think that it will be realistically possible to get rid of Reflection usage in WebLaF unless Oracle or whoever works on Open JDK would make some sweeping changes in Swing framework to cleanup it's API. Also I can't really do anything to workaround this on WebLaF's side, unfortunately. I have a wiki article that properly explains the cause of these warnings and how you can avoid them in your app: |
As a side note - all calls to proprietary "stuff" in WebLaF are properly hidden behind Reflection so they wouldn't cause any exceptions or warnings at compile time. But the issue with Java 9+ remains as that is a runtime thing. |
Also the last log line -
Is a recent XStream change that is unrelated to previous messages. I'm pretty sure I already fixed it in one of the commits for 1.2.14, but I will double-check this tomorrow. |
I did follow everything in that wiki and called each one of them when running the at the start of the app. I still get them though. Don't know why. |
Maybe there were some additions that aren't in the list, although I checked recently and it was up-to-date. |
Have you solved this or can you provide the exact message/warning you're getting? |
@karelkryda There is, unfortunately, no way to avoid this due to how Reflection was changed in Java 9+. There are quite a few critical calls to proprietary APIs that have to be made in order for L&F to setup everything properly, so there is no good solution for that problem except for providing access to all required modules explicitly via JVM options. And a lot of those cannot be done on library side anyhow unfortunately. |
I'll be closing this issue as there is already an older one opened for JDK 12+: #525 |
I use JDK 11 and have this reflective access below when using weblaf at the start of my app :
I know this is an x-stream issue and we probably discussed this in other threads in the past.
Now one good news is that someone shared the thread below reporting that by switching to x-stream 1.4.13 (needed by
launch4j-maven-plugin
), the problem went away.See x-stream/xstream#101 (comment)
Can you try if it works in weblaf as well ?
The text was updated successfully, but these errors were encountered: