JDK16 compatibility issues
See original GitHub issueAre you looking for help?
Checking if it’s possible to migrate development on JDK16
Lagom Version (1.2.x / 1.3.x / etc)
1.6.5
API (Scala / Java / Neither / Both)
Java/maven
Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)
MacOS Big Sur
JDK (Oracle 1.8.0_112, OpenJDK 1.8.x, Azul Zing)
16.0.1.hs-adpt
Library Dependencies
Expected Behavior
Please describe the expected behavior of the issue, starting from the first action.
- run
mvn clean install
Actual Behavior
Project passes but stops when integration suite kicks off.
- Issue when starting Kafka
java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @654b5005
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at javassist.util.proxy.SecurityActions.setAccessible(SecurityActions.java:159)
at javassist.util.proxy.DefineClassHelper$JavaOther.defineClass(DefineClassHelper.java:213)
at javassist.util.proxy.DefineClassHelper$Java11.defineClass(DefineClassHelper.java:52)
at javassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:263)
at javassist.ClassPool.toClass(ClassPool.java:1232)
at javassist.ClassPool.toClass(ClassPool.java:1090)
at javassist.ClassPool.toClass(ClassPool.java:1048)
at javassist.CtClass.toClass(CtClass.java:1290)
at org.apache.curator.test.ByteCodeRewrite.fixMethods(ByteCodeRewrite.java:95)
at org.apache.curator.test.ByteCodeRewrite.<clinit>(ByteCodeRewrite.java:50)
at org.apache.curator.test.TestingServer.<clinit>(TestingServer.java:33)
at com.lightbend.lagom.internal.kafka.KafkaLocalServer$ZooKeeperLocalServer.start(KafkaLocalServer.scala:177)
at com.lightbend.lagom.internal.kafka.KafkaLocalServer.start(KafkaLocalServer.scala:36)
at com.lightbend.lagom.internal.kafka.KafkaLauncher$.main(KafkaLauncher.scala:49)
at com.lightbend.lagom.internal.kafka.KafkaLauncher.main(KafkaLauncher.scala)
- Issue when starting Cassandra
Exception (java.lang.AssertionError) encountered during startup: java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.io.FileDescriptor.fd accessible: module java.base does not "opens java.io" to unnamed module @654b5005
java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.io.FileDescriptor.fd accessible: module java.base does not "opens java.io" to unnamed module @654b5005
at org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:608)
at org.apache.cassandra.utils.NativeLibrary.<clinit>(NativeLibrary.java:80)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:196)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:602)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:691)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.io.FileDescriptor.fd accessible: module java.base does not "opens java.io" to unnamed module @654b5005
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:177)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:171)
at org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:603)
... 4 more
07/26 13:41:54 ERROR[main] o.a.c.s.CassandraDaemon - Exception encountered during startup
java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.io.FileDescriptor.fd accessible: module java.base does not "opens java.io" to unnamed module @654b5005
at org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:608) ~[cassandra-bundle.jar:1.0.0-M0+46-b373604e]
at org.apache.cassandra.utils.NativeLibrary.<clinit>(NativeLibrary.java:80) ~[cassandra-bundle.jar:1.0.0-M0+46-b373604e]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:196) ~[cassandra-bundle.jar:1.0.0-M0+46-b373604e]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:602) ~[cassandra-bundle.jar:1.0.0-M0+46-b373604e]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:691) ~[cassandra-bundle.jar:1.0.0-M0+46-b373604e]
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.io.FileDescriptor.fd accessible: module java.base does not "opens java.io" to unnamed module @654b5005
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357) ~[na:na]
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[na:na]
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:177) ~[na:na]
at java.base/java.lang.reflect.Field.setAccessible(Field.java:171) ~[na:na]
at org.apache.cassandra.utils.FBUtilities.getProtectedField(FBUtilities.java:603) ~[cassandra-bundle.jar:1.0.0-M0+46-b373604e]
... 4 common frames omitted
- Issue starting Service Locator
[ERROR] Failed to execute goal com.lightbend.lagom:lagom-maven-plugin:1.6.5:startAll (default) on project integration-tests: Execution lagom-internal-request of goal com.lightbend.lagom:lagom-maven-plugin:1.6.5:startServiceLocator failed: Failed to start embedded Service Locator or Service Gateway. Hint: Are ports 9008 or 9000 already in use?: java.lang.IllegalStateException: Unable to load cache item: ExceptionInInitializerError: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @5d604f00 -> [Help 1]
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
JDK 16 Release Notes - Oracle
The Kinds of Compatibility page on the OpenJDK wiki identifies three types of potential compatibility issues for Java programs used in these descriptions:....
Read more >system lambda jdk 16 compatibility issue #1942 - GitHub
We use system-lambda for testing custom environment variables. There is a known compatibility issue with JDK16 that makes some of our tests ...
Read more >Issue setting Java Compliance level to newest JDK (16)
The Spring Tools for Eclipse 4.9.0 release is based on Eclipse 2020-12, which didn't come with support for JDK16. Therefore you don't see...
Read more >OpenJDK Life Cycle and Support Policy - Red Hat Customer ...
OpenJDK versions can fall out of support on versions of RHEL if the ... to the most recent release to help reproduce and...
Read more >Compatibility Issues with Java SE 11 and Later - Aspose Forums
We've performed an analysis on Aspose.Words for Java 22.4 (both JDK1.6 and 1.7) for any potential incompatibilities with Oracle Java SE 11 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I know that cassandra just “recently” supports java 11 in new 4.x version (currently 4.0-RC2). I think lagom uses in development mode cassandra 3.x which is not working on jdk 11 and should not work on 16 either
For what it’s worth, I’ve found that it’s the Cassandra driver using good old reflection that newer Java versions no longer support unless you explicitly enable via
—illegal-access=permit
as a jvm flag in maven. I’ve had this work in development, but not tested in a full production environment (yet).