-
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
java 9 + jigsaw compatibility #74
Comments
I know, it breaks, since Jigsaw was integrated. But I had no time to work on it. Most problems are caused by the tests itself, because when serializing JDK types, it will also use reflection to access the internals. And currently these internals are neither accessible anymore and they are moved every second week (my gut's telling). For people serializing their own stuff, it will make no difference, but it will have implications for XStream users that serialize these types also. |
From what I can tell then XStream has several issues when running on JDK 9. One is that it seems to have a couple of hacks where it attempts to use setAccessible to get a non-public members of JDK classes, e.g. the protected getName method on AttributedCharacterIterator.Attribute. The bigger issue is that it's a custom serialization library and so will not be able to use setAccessible to break into non-exported packages or non-public elements in exported packages. There is an updated sun.reflect.ReflectionFactory in JDK 9 (and in jdk8u-dev for a future JDK 8 update) to help custom serialization libraries invoke non-public readObject/writeObject/etc. methods. It may be that XStream will need to use these. |
FWIW, this is breaking the maven-war-plugin. See also https://cwiki.apache.org/confluence/display/MAVEN/Java+9+-+Jigsaw in section "Third party components". For me the exception looks like this (JDK 9 b154 from https://copr.fedorainfracloud.org/coprs/omajid/openjdk9/):
|
Hello @joehni , Thank you |
I am closing this, since it is a duplicate of #101 which reflects the situation with the final release of Java 9. |
I tried to build xstream using JDK9 jigsaw preview. For this purpose I used this dockerfile :
Such a build fails running tests. This seems to demonstrate xstream won't be compatible with Java 9 when released (on March 2017). I suggest to run some tests with preview so any isssue with JDK 9 . JDK APIs / Jigsaw can be reported to JDK development team.
The text was updated successfully, but these errors were encountered: