kotlin - 如何在调试中修复 ClassNotFoundException: kotlinx.coroutines.debug.AgentPremain?
问题描述
我正在运行几个项目作为 Spring Boot 应用程序,其中一个特别无法启动并且正在抛出:
java.lang.ClassNotFoundException: kotlinx.coroutines.debug.AgentPremain
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:304)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Exception in thread "main" FATAL ERROR in native method: processing of -javaagent failed
Disconnected from the target VM, address: '127.0.0.1:64279', transport: 'socket'
Process finished with exit code 1
命令行有以下选项:
-javaagent:[...].m2/repository/org/jetbrains/kotlinx/kotlinx-coroutines-core/1.5.0/kotlinx-coroutines-core-1.5.0.jar
而这个罐子是存在的。
这是在将我的 Intellij'Idea 更新到 2021.2 之后发生的
此问题仅在调试模式下发生。
知道如何解决这个问题吗?
解决方案
这是 Kotlin 插件中的一个已知问题。作为一种解决方法,禁用Settings/Preferences | Build, Execution, Deployment | Debugger | Data Views | Kotlin | enable "Disable coroutine agent"
.
推荐阅读
- asp.net-core - 在 ASP.NET Core 中防止拒绝服务 (DoS) 攻击的最佳实践
- python - 为什么我得到这些不同的输出?
- firebase - .set / .update 集合或文档,但仅限于本地?
- scrapy - 在中间件中调用 process_exception() 时触发 errback
- php - Wordpres PHP 字符串替换
- angular - 更改检测似乎不适用于动态实例化的组件
- javascript - 如何使用 reactjs 中的 graphql 在数据库中插入数据?
- python - Python 和 Pandas - 按日期排序
- graphql - 使用 gatsby-image 和 graphql 获取图像时不断出错
- c# - 异步任务似乎同步运行