Kotlin / kotlin-jupyter

Kotlin kernel for Jupyter/IPython
Apache License 2.0
1.09k stars 106 forks source link

why ctor argument type mismatch #433

Closed 956237586 closed 9 months ago

956237586 commented 9 months ago

i want to execute kotlin script dynamic in idea plugin env for invoke idea open api

  1. i try embed kotlin-jupyter to idea plugin and launch kernel using /org/jetbrains/kotlinx/jupyter/IkotlinKt.class: embedKernel jar file is kotlin-jupyter-kernel-0.11.0-358.jar
  2. change script classpath using following code
    import kotlin.script.experimental.jvm.util.KotlinJars
    import kotlin.script.experimental.jvm.util.scriptCompilationClasspathFromContextOrStdlib
    val ideaCp1 = scriptCompilationClasspathFromContextOrStdlib(wholeClasspath = true, classLoader = classLoader) + KotlinJars.kotlinScriptStandardJars
  3. execute import com.intellij.openapi.ui.Messages.showInfoMessage in jupyterlab and i got error below
    argument type mismatch
    java.lang.IllegalArgumentException: argument type mismatch
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    at kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.evalWithConfigAndOtherScriptsResults(BasicJvmScriptEvaluator.kt:105)
    at kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.invoke$suspendImpl(BasicJvmScriptEvaluator.kt:47)
    at kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.invoke(BasicJvmScriptEvaluator.kt)
    at kotlin.script.experimental.jvm.BasicJvmReplEvaluator.eval(BasicJvmReplEvaluator.kt:49)
    at org.jetbrains.kotlinx.jupyter.repl.impl.InternalEvaluatorImpl$eval$resultWithDiagnostics$1.invokeSuspend(InternalEvaluatorImpl.kt:103)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at org.jetbrains.kotlinx.jupyter.repl.impl.InternalEvaluatorImpl.eval(InternalEvaluatorImpl.kt:103)
    at org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$result$1.invoke(CellExecutorImpl.kt:75)
    at org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$result$1.invoke(CellExecutorImpl.kt:73)
    at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.withHost(repl.kt:666)
    at org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute(CellExecutorImpl.kt:73)
    at org.jetbrains.kotlinx.jupyter.repl.CellExecutor$DefaultImpls.execute$default(CellExecutor.kt:15)
    at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl$evalEx$1.invoke(repl.kt:479)
    at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl$evalEx$1.invoke(repl.kt:470)
    at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.withEvalContext(repl.kt:433)
    at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.evalEx(repl.kt:470)
    at org.jetbrains.kotlinx.jupyter.messaging.ProtocolKt$shellMessagesHandler$2$res$1.invoke(protocol.kt:318)
    at org.jetbrains.kotlinx.jupyter.messaging.ProtocolKt$shellMessagesHandler$2$res$1.invoke(protocol.kt:312)
    at org.jetbrains.kotlinx.jupyter.JupyterExecutorImpl$runExecution$execThread$1.invoke(execution.kt:37)
    at org.jetbrains.kotlinx.jupyter.JupyterExecutorImpl$runExecution$execThread$1.invoke(execution.kt:32)
    at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)
  4. follow stacktrace i debug at kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.evalWithConfigAndOtherScriptsResults(BasicJvmScriptEvaluator.kt:105)

image

class org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl is implement interface jupyter.kotlin.providers.UserHandlesProvider why argument type mismatch?

956237586 commented 9 months ago

ikotlin launch log belog

2023-09-27 10:47:27,390 [ 858837]   INFO - STDERR - 842483 [Thread-114] INFO  c.h.s.plugin.idea.KotlinReplWrapper - Begin listening for events
2023-09-27 10:47:27,391 [ 858838]   INFO - STDERR - 842484 [Thread-114] INFO  ikotlin - Detecting Jupyter client type
2023-09-27 10:47:27,423 [ 858870]   INFO - STDERR - 842515 [Thread-114] INFO  ikotlin - Inspecting process: C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains\jbre\jbr_jcef-17.0.6-windows-x64-b829.9\extracted\jbr_jcef-17.0.6-windows-x64-b829.9\bin\java.exe
2023-09-27 10:47:27,424 [ 858871]   INFO - STDERR - 842517 [Thread-114] INFO  ikotlin - Inspecting process: D:\lib\jdk-17\bin\java.exe
2023-09-27 10:47:27,425 [ 858872]   INFO - STDERR - 842518 [Thread-114] INFO  ikotlin - Inspecting process: D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\bin\idea64.exe
2023-09-27 10:47:27,425 [ 858872]   INFO - STDERR - 842518 [Thread-114] INFO  ikotlin - Detected type is KERNEL_TESTS
2023-09-27 10:47:27,627 [ 859074]   INFO - STDERR - 842720 [Thread-114] INFO  ikotlin - Starting kotlin REPL engine. Compiler version: 1.8.20
2023-09-27 10:47:27,627 [ 859074]   INFO - STDERR - 842720 [Thread-114] INFO  ikotlin - Kernel version: 0.0.1
2023-09-27 10:47:27,628 [ 859075]   INFO - STDERR - 842720 [Thread-114] INFO  ikotlin - Classpath used in script: [C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\app.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\3rd-party-rt.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\util.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\util_rt.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\util-8.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\jps-model.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\stats.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\protobuf.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\external-system-rt.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\intellij-test-discovery.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\forms_rt.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\rd.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\externalProcess-rt.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\annotations.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\byte-buddy-agent.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\error-prone-annotations.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\groovy.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\idea_rt.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\intellij-coverage-agent-1.0.706.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\jsch-agent.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\junit.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\junit4.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\ant\lib\ant.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\marketplace\lib\boot\marketplace-impl.jar, C:\Users\HUANGY~1\AppData\Local\Temp\byteBuddyAgent15514631103105662874.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\featuresTrainer\lib\featuresTrainer.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\performanceTesting\lib\performanceTesting.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\vcs-git\lib\vcs-git.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\vcs-git\lib\git4idea-rt.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\platform-images\lib\platform-images.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\copyright\lib\copyright.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\javac2.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\java-impl.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\jb-jdi.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\sa-jdwp.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\jps-builders.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\jps-launcher.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\jgoodies-common.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\jshell-frontend.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\jshell-protocol.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\jps-javac-extension.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\debugger-memory-agent.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\aether-dependency-resolver.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\plugins\java\lib\jps-builders-6.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-serialization-1.8.20-gradle74.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-gradle-plugin-api-1.8.20-gradle74.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\jna-5.6.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\jnacl-1.0.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\jeromq-0.5.3.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\httpcore5-5.2.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\okhttp-4.10.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\okio-jvm-3.0.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\clikt-jvm-2.8.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\slf4j-api-2.0.5.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\vertx-web-4.3.2.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\httpcore5-h2-5.2.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\json5k-jvm-0.3.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\vertx-core-4.3.2.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\httpclient5-5.2.1.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\skykoma-plugin-idea\lib\annotations-23.1.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\logback-core-1.3.6.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\jackson-core-2.13.2.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\http4k-core-4.34.3.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-stdlib-1.8.21.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\trove4j-1.0.20200330.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-reflect-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-util-io-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\logback-classic-1.3.6.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\vertx-web-client-4.3.2.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\vertx-web-common-4.3.2.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\vertx-auth-common-4.3.2.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-codec-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\vertx-uri-template-4.3.2.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-script-util-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-stdlib-jdk7-1.8.21.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-stdlib-jdk8-1.8.21.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-buffer-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-common-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\vertx-bridge-common-4.3.2.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-native-utils-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-tooling-core-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-handler-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-daemon-client-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-project-model-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-scripting-jvm-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-stdlib-common-1.8.21.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-resolver-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-script-runtime-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-codec-dns-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-transport-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\http4k-client-apache-4.34.3.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-jupyter-api-0.11.0-385.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-jupyter-lib-0.11.0-385.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-codec-http-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-scripting-common-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-codec-http2-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-codec-socks-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-daemon-embeddable-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-resolver-dns-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-jupyter-kernel-0.11.0-385.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-handler-proxy-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-compiler-embeddable-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlinx-coroutines-core-jvm-1.6.4.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-scripting-ide-services-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlinx-serialization-core-jvm-1.5.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlinx-serialization-json-jvm-1.5.0.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\instrumented-MY_PLUGIN_NAME-0.0.8.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-gradle-plugin-annotations-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-jupyter-shared-compiler-0.11.0-385.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-scripting-compiler-embeddable-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-jupyter-common-dependencies-0.11.0-385.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-scripting-dependencies-maven-all-1.8.20.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\netty-transport-native-unix-common-4.1.78.Final.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-scripting-compiler-impl-embeddable-1.8.20.jar, C:\Users\MY_USERNAME\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2023.1.1\770a0552545fe6ab0de3e2f8ac9adb7ea3046417\ideaIC-2023.1.1\lib\3rd-party-rt.jar, D:\code\source\MY_PLUGIN_NAME\build\idea-sandbox\plugins\MY_PLUGIN_NAME\lib\kotlin-script-runtime-1.8.20.jar]
956237586 commented 8 months ago

update slove by setContextClassLoader

Thread thread = new Thread(() -> {
    embedKernel(xxxxx)
});
thread.setContextClassLoader(pluginClassLoader);
thread.start();