When used with Kotlin 2.0.20, SekretComponentRegistrar throws the exception java.lang.NoClassDefFoundError: org/jetbrains/kotlin/ir/util/IrMessageLoggerKt (Full stacktrace below). Things work as expected when using Kotlin 2.0.0 or 2.0.10.
Looking at the kotlin-compiler-embeddable JAR, the IrMessageLogger interface does not exist in the 2.0.20 JAR.
I'm attaching a minimal example -- sekret-minimal-project.zip -- that demonstrates the error. But in a nutshell, we are just using the @Secret annotation on a valin a Data Class, and then calling toString() on the data class.
java.lang.NoClassDefFoundError: org/jetbrains/kotlin/ir/util/IrMessageLoggerKt
at dev.datlag.sekret.SekretComponentRegistrar.registerExtensions(SekretComponentRegistrar.kt:28)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli_base(KotlinCoreEnvironment.kt:772)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerExtensionsFromPlugins(KotlinCoreEnvironment.kt:194)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.configureProjectEnvironment(KotlinCoreEnvironment.kt:652)
at org.jetbrains.kotlin.cli.jvm.compiler.pipeline.JvmCompilerPipelineKt.createProjectEnvironment(jvmCompilerPipeline.kt:398)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:141)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:43)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:103)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:49)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:464)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:73)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.doCompile(IncrementalCompilerRunner.kt:506)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:423)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileNonIncrementally(IncrementalCompilerRunner.kt:301)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:129)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:675)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:92)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1660)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:714)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:598)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:844)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:721)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:720)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.ClassNotFoundException: org.jetbrains.kotlin.ir.util.IrMessageLoggerKt
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
... 34 more
It looks like this was deliberately removed in Kotlin 2.0.20. See Delete the IrMessageLogger interface in JetBrain's YouTrack. Looks like MessageCollector can now be used directly.
Sekret Version: 2.0.0-alpha-06
When used with Kotlin 2.0.20,
SekretComponentRegistrar
throws the exceptionjava.lang.NoClassDefFoundError: org/jetbrains/kotlin/ir/util/IrMessageLoggerKt
(Full stacktrace below). Things work as expected when using Kotlin 2.0.0 or 2.0.10.Looking at the
kotlin-compiler-embeddable
JAR, theIrMessageLogger
interface does not exist in the 2.0.20 JAR.I'm attaching a minimal example -- sekret-minimal-project.zip -- that demonstrates the error. But in a nutshell, we are just using the
@Secret
annotation on aval
in a Data Class, and then callingtoString()
on the data class.