Skip to content

Commit 26050ed

Browse files
derrickburnsclaude
andcommitted
fix(java17): add java.lang.invoke module opens for Kryo serialization
Add --add-opens=java.base/java.lang.invoke=ALL-UNNAMED to test JVM options to fix InaccessibleObjectException with Kryo serialization under Java 17. This resolves the following error: ``` java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.Class java.lang.invoke.SerializedLambda.capturingClass accessible: module java.base does not "opens java.lang.invoke" to unnamed module ``` The Java Platform Module System (JPMS) in Java 9+ restricts reflective access to internal JDK classes. Spark's Kryo serializer needs reflective access to SerializedLambda for serializing closures. Tested locally: all 37 GKMErrorSuite tests now pass. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0dbfc69 commit 26050ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@
4242
Test / testOptions += Tests.Argument("-Dlog4j.configurationFile=log4j2.properties")
4343
Test / fork := true
4444
Test / javaOptions ++= Seq(
45+
"--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
4546
"--add-opens=java.base/java.nio=ALL-UNNAMED",
46-
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
47+
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
4748
"--add-opens=java.base/sun.security.action=ALL-UNNAMED",
4849
"--add-opens=java.base/sun.util.calendar=ALL-UNNAMED",
4950
"-Djava.awt.headless=true",

0 commit comments

Comments
 (0)