-
Notifications
You must be signed in to change notification settings - Fork 227
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
Fails on Java 16 for java.util.Arrays$ArrayList and java.util.Collections$EmptyList #253
Comments
Btw, if I use Java 9+
Workaround for this is |
Hi, well, none of this fails (XStream has unit tests for these types running with Java 16), but you have to run XStream in the classpath. I guess, this is not an option for Quarkus. However, the workaround does not produce objects with same behaviour after deserialization. An empty list where you can add objects after deserialization might cause some other surprises. |
Hi and thanks for your feedback!
Depends on your POV, but I'm getting a
Might be a bit too late for me but I'm not fully sure what that means. There is some classloader juggling in Quarkus but nevertheless XStream is "on the classpath". What am I missing?
Of course you are right. |
Look at the CI results, if you do not believe it:
You run XStream in the ModulePath and Java's module system does not allow XStream to access the internals of the referenced classes. |
Hm, I just got confirmation that Quarkus is not doing anything with the module path. Will have to take a deeper dive... |
For Java 16 you'll need option --illegal-access=permit |
Will this be a requirement also for xstream 1.5? |
Shouldn't this flag also work?
|
Also, I only get this issue when compiling with JDK 11 and then running on JDK16, compiling on JDK16 fixes it but forces users to upgrade |
@joehni Hi. What about java 17 where Thanks a lot |
@vmassol what JDK do you compile on? |
@xeruf Thanks. I don't compile, just execute. I got it to work using the following JVM parameters indeed: Thanks! |
It works for me! |
As you already have noticed, starting with Java 17 you will have to open the modules, which will work also for the older Java versions instead of the --illegal-access option (that no longer exists with Java 17). |
Over at Quarkus (see also quarkusio/quarkus#17091), I had to disable two test classes for the JDK 16 CI job due to:
Conversions fails for
Arrays.asList(...)
:Conversions fails for
Collections.emptyList()
:This is with 1.4.16 and current 1.5.0-SNAPSHOT.
PS: I suppose there is a strong connection to #101.
The text was updated successfully, but these errors were encountered: