作为 Windows 服务启动的 Java 应用程序的远程调试
我的 Java 应用程序是通过 java.dll 从本机程序中启动的。 该本机程序作为 Windows 上的服务启动。
以下选项已添加到 JVM 参数中以进行远程调试:
-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
在此配置中,无法从我的 Eclipse 工作区等进行连接。 如果程序是从命令行启动的,即不是作为服务启动,我可以连接到端口 8787。
如何允许远程调试连接到该服务?
My Java application is started from within a native program through java.dll. This native program is launched as a service on Windows.
The following options have been added to the JVM args for remote debugging:
-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
In this configuration, it is impossible to connect from e.g. my Eclipse workspace. If the program is launched from the command-line, i.e. not as a service, I can connect to port 8787.
How can I allow remote debugging connections to this service?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果它作为服务运行或从命令行运行,则没有区别。
请仔细检查 java.exe 在作为服务启动时是否收到这些命令行参数。
There's no difference if it runs as a service or from command line.
Please double-check that java.exe receives those command line params when started as service.