Assert Java 9 compatibility [DATACMNS-1033] #1481
Comments
John Blum commented
|
Jens Schauder commented When compiling commons or the examples maven produces the following error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project spring-data-cassandra-example-utils: Fatal error compiling: java.lang.ExceptionInInitializerError: Unable to make field private com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs accessible: module jdk.compiler does not "opens com.sun.tools.javac.processing" to unnamed module This seems to come from our use of Lombok. See rzwitserloot/lombok#985 |
Jens Schauder commented DefaultMethodInvokingMethodInterceptor is not Java 9 compatible. It causes
There should be a fix possible. See: http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-March/046567.html And there is already a separate issue for it: DATACMNS-991 |
Jens Schauder commented Current status:
|
Jens Schauder commented The build needs to run with
Order to avoid Even with the maven-option, an error is logged, but the plugin reports a success and the build continues |
Jens Schauder commented Static inner classes with |
Jens Schauder commented Code generation of QueryDSL fails in tests: querydsl/querydsl#2151 |
Jens Schauder commented -Something is wrong with the initialization of the DataSource in Spring Boot, causing at least some of the JPA test fail during setup, because the DataSource is null.- -Note that the DataSource does get instantiated, but the DataSourceInitializer never gets its |
Jens Schauder commented This comment is to collect failure modes users might see and what they need to change on their side. Although it is only indirectly related to Spring Data, I guess it would be nice to have a place where people can find this kind of stuff.
Explanation jaxb is in a separate module and access to it needs to be granted separately. Fix add {--add-modules java.xml.bind} to the relevant java process. The relevant java process might be: The one actually executing the code, e.g. the commandline used to start a webserver; The part that executes some test, e.g. the surefire plugin of Maven, or javac when this happens during compiling (this would be customer code accessing jaxb, so completely unrelated to Spring Data, but still)
Explanation Hibernate (and most certainly other JPA providers) do all kind of stuff that is not Ok with JDK 9 Fix Short term: add Long term: Use Hibernate 5.x and request build time byte code enhancement; Test your application carefully, since this might introduce subtile changes in behaviour according to https://stackoverflow.com/questions/43258796/hibernate-support-for-java-9 this SO answer I currently cannot confirm that this works, since I get exceptions like the following:
|
Jens Schauder commented The CI builds fails with what might be a javadoc bug, but I can't reproduce it with a simple test case. My failed attempt is here: https://github.com/schauder/javadoc-arity-bug/tree/master |
Jens Schauder commented There now is an issue in the jdk9 tracker: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8186841 |
Oliver Drotbohm commented Regarding the correct invocation of default methods, this blog by Lukas Eder |
Mark Paluch commented Java 9 compatibility asserted, Spring Data Examples builds with Java 9 in place, see spring-projects/spring-data-examples#360 |
Mark Paluch commented Closing this one as compatibility with Java 9 and 10 is given. Issues that prevented usage of Spring Data were fixed in the linked tickets, upstream dependencies, and the Java runtime. We'll revisit building Spring Data with a newer JDK in the scope of a future ticket |
John Blum opened DATACMNS-1033 and commented
Assert compatibility of Spring Data Commons on Java 9.
Setup Travis CI build using JDK 9.
State of compatibility:
--permit-illegal-access
--permit-illegal-access
ClassGeneratingPropertyAccessor
cannot be used which should result in worse performance. See DATACMNS-1080Issue Links:
DATACASS-444 Spring Data Example Tests fail with JDK 9
DATACMNS-1079 ClassGeneratingPropertyAccessorFactory fails on Java 9
DATAES-354 Spring Data Example Tests fail with JDK 9
DATACMNS-990 Enable building with JDK11+
SPR-14579 Document Spring recommendations/restrictions for Java 9 module setups
DATACMNS-991 Update DefaultMethodInvokingMethodInterceptor to Java 9 compatible method handle invocation
DATACMNS-1080 Inject generated property accessor classes via ReflectUtils.defineClass(…)
DATAKV-180 Spring Data Example Tests fail with JDK 9
DATALDAP-38 Spring Data Example Tests fail with NoClassDefFoundError: LdapContextSource
1 votes, 6 watchers
The text was updated successfully, but these errors were encountered: