繁体   English   中英

无法将远程调试器附加到 Eclipse OSGi 应用程序

[英]Unable to attach remote debugger to Eclipse OSGi application

我正在尝试使用 Intellij IDEA 的远程运行配置远程调试 Eclipse (OSGi) 应用程序。 不幸的是,每次我在 Eclipse 中运行该应用程序时,该应用程序都不会等待远程连接,而且我无法将远程调试器附加到它。

我通过将以下参数添加到Run > Run Configurations... > Eclipse Application > Arguments来配置 Eclipse 运行配置: -agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=y

当我在 Eclipse 中运行配置时,应用程序立即启动,而不是等待远程连接的 JVM,即使我定义了suspend=y参数。 如果我尝试运行 Intellij 远程配置,它会显示以下消息: Unable to open debugger port (localhost:6000): java.net.ConnectException "Connection refused: connect"

我还尝试让 Eclipse 应用程序附加(而不是监听)到 Intellij IDEAs 远程调试器,但它也没有用(应用程序没有尝试连接到远程调试器)。

下图显示了运行配置:

Eclipse Application's run configurationIntellij IDEA's remote configuration

其他信息:

  • 操作系统: Windows 10
  • Eclipse: Eclipse 提交者的 Eclipse IDE 2019-09 R (4.13.0)
  • Intellij IDEA:2019.3

正如@howlger他的评论中指出的那样,该参数的正确位置是在“ VM arguments ”(而不是“ Program arguments ”)中。 更改之后,应用程序现在可以正确地等待调试器附加。

Eclipse 应用程序的固定运行配置

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM