[ https://issues.apache.org/jira/browse/CASSANDRA-18180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17719564#comment-17719564 ]
dan jatnieks commented on CASSANDRA-18180: ------------------------------------------ I created a patch that implements {{sun.nio.ch.DirectBuffer}} in {{BufferPool$Chunk}} and {{Ref}} - doing this resolves the {{ClassCastException}} coming from {{GaloisCounterMode.overlapDetection}}. Since {{DirectBuffer}} is not publicly exposed, to make compilation work for JDK11/17 it's necessary to add exports for {{java.base/jdk.internal.ref}} and {{java.base/sun.nio.ch}}. There is also a change to how {{TestNameCheckTask}} is invoked by {{build.xml}}. Since {{TestNameCheckTask}} uses {{Reflections}} to get the methods annotated with {{@Test}}, and that involves loading classes with the ClassLoader it also needs to pass jvm args for jdk11/17 to avoid {{IllegalAccessError}} to {{sun.nio.ch.DirectBuffer}} (not exported by {{java.base}}). To accomplish this, the {{checktestnameshelper}} ant task in {{build.xml}} is replaced with a java task, passing the necessary jvm args. Note: these changes are not compatible with JDK8. ||Branch||CI|| |[trunk|https://github.com/djatnieks/cassandra/tree/CASSANDRA-18180]|[java 11|https://app.circleci.com/pipelines/github/djatnieks/cassandra/3/workflows/7ba8f619-835e-4464-b5a0-6c828352e3d0] [java 17|https://app.circleci.com/pipelines/github/djatnieks/cassandra/3/workflows/86cc2e85-e718-4d09-aa55-fbec0c399733]| > bulkLoaderSuccessfullyStreamsOverSsl fails with ClassCastException on JDK17 > --------------------------------------------------------------------------- > > Key: CASSANDRA-18180 > URL: https://issues.apache.org/jira/browse/CASSANDRA-18180 > Project: Cassandra > Issue Type: Bug > Components: CI > Reporter: Ekaterina Dimitrova > Assignee: dan jatnieks > Priority: Normal > > While working on CASSANDRA-17992 we hit: > {code:java} > java.lang.ClassCastException: class > org.apache.cassandra.utils.memory.BufferPool$Chunk cannot be cast to class > sun.nio.ch.DirectBuffer (org.apache.cassandra.utils.memory.BufferPool$Chunk > is in unnamed module of loader 'app'; sun.nio.ch.DirectBuffer is in module > java.base of loader 'bootstrap')\n\tat > java.base/com.sun.crypto.provider.GaloisCounterMode$GCMEngine.overlapDetection(GaloisCounterMode.java:865)\n\tat > > java.base/com.sun.crypto.provider.GaloisCounterMode$GCMDecrypt.doFinal(GaloisCounterMode.java:1502)\n\tat > > java.base/com.sun.crypto.provider.GaloisCounterMode.engineDoFinal(GaloisCounterMode.java:447)\n\tat > > {code} > -The issue is exposed with JDK 17, trunk; if interested, ping- [~e.dimitrova] > -for current branch as there is no feature branch at the moment- we can > build and start from trunk with JDK17 already. Circle CI can be run for JDK17 > too. For more information how to do that - .circleci/readme.md > CC [~benedict] -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org