简体   繁体   English

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

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

I'm trying to remote debug an Eclipse (OSGi) Application using the Intellij IDEA's Remote run configuration.我正在尝试使用 Intellij IDEA 的远程运行配置远程调试 Eclipse (OSGi) 应用程序。 Unfortunately, every time I run the application in Eclipse, the app never waits for a remote connection and I'm unable to attach a remote debugger to it.不幸的是,每次我在 Eclipse 中运行该应用程序时,该应用程序都不会等待远程连接,而且我无法将远程调试器附加到它。

I configured the Eclipse run configuration by adding the following argument to Run > Run Configurations... > Eclipse Application > Arguments : -agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=y .我通过将以下参数添加到Run > Run Configurations... > Eclipse Application > Arguments来配置 Eclipse 运行配置: -agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=y

When I run the configuration in Eclipse the application starts immediately instead of the JVM waiting for the remote connection, even though I defined the suspend=y parameter.当我在 Eclipse 中运行配置时,应用程序立即启动,而不是等待远程连接的 JVM,即使我定义了suspend=y参数。 If I try to run the Intellij remote configuration, it gives the following message: Unable to open debugger port (localhost:6000): java.net.ConnectException "Connection refused: connect" .如果我尝试运行 Intellij 远程配置,它会显示以下消息: Unable to open debugger port (localhost:6000): java.net.ConnectException "Connection refused: connect"

I also tried to make the Eclipse app attach (instead of listening) to the Intellij IDEAs remote debugger, but it also didn't work (the app didn't try to connect to the remote debugger).我还尝试让 Eclipse 应用程序附加(而不是监听)到 Intellij IDEAs 远程调试器,但它也没有用(应用程序没有尝试连接到远程调试器)。

The following images show the run configurations:下图显示了运行配置:

Eclipse Application's run configurationIntellij IDEA's remote configuration

Other information:其他信息:

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

As @howlger pointed out in his comment , the correct place for that argument is in the " VM arguments " (not the " Program arguments ").正如@howlger他的评论中指出的那样,该参数的正确位置是在“ VM arguments ”(而不是“ Program arguments ”)中。 After that change, the application now correctly waits for the debugger to attach.更改之后,应用程序现在可以正确地等待调试器附加。

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

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

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