fwcd / kotlin-debug-adapter

Kotlin/JVM debugging for any editor/IDE using the Debug Adapter Protocol
MIT License
111 stars 19 forks source link

internal error (Caused by: kotlin.KotlinNullPointerException) #23

Closed ilovelili closed 4 years ago

ilovelili commented 4 years ago

I got kotlin.KotlinNullPointerException when try to debug. The error seems to be caused by JDILauncher.createLaunchArgs

The full error log:

[ERROR]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

[ERROR]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

[ERROR]     at java.base/java.lang.Thread.run(Thread.java:834)

[ERROR] Caused by: kotlin.KotlinNullPointerException

[ERROR]     at fwcd.ktda.jdi.launch.JDILauncher.createLaunchArgs(JDILauncher.kt:55)

[ERROR]     at fwcd.ktda.jdi.launch.JDILauncher.launch(JDILauncher.kt:37)

[ERROR]     at fwcd.ktda.jdi.launch.JDILauncher.launch(JDILauncher.kt:24)

[ERROR]     at fwcd.ktda.adapter.KotlinDebugAdapter$launch$1.invoke(KotlinDebugAdapter.kt:99)

[ERROR]     at fwcd.ktda.adapter.KotlinDebugAdapter$launch$1.invoke(KotlinDebugAdapter.kt:35)

[ERROR]     at fwcd.ktda.util.AsyncExecutorKt$sam$java_lang_Runnable$0.run(AsyncExecutor.kt)

[ERROR]     at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
...

It seems to be caused by argument null dereference

My java environment is

java --version
openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

Thanks! Min

fwcd commented 4 years ago

@ilovelili This is probably caused by API changes in the Java Debug Interface on JDK 11. Could you check whether the issue persists on JDK 8?

ilovelili commented 4 years ago

The issue disappeared after I switched to JDK 8. Thank you!

rosenk commented 4 years ago

Why this issue is closed? JVM 11 is the current LTS version. Isn't it the default version for most developers?

fwcd commented 3 years ago

I have moved this into a new issue: https://github.com/fwcd/kotlin-debug-adapter/issues/31