简体   繁体   English

在Eclipse中调试远程应用程序?

[英]Debugging remote application in eclipse?

I am trying to debug my remote application. 我正在尝试调试远程应用程序。 In one of my project documents I found these steps. 在我的一个项目文档中,我找到了这些步骤。

  • Set run time Parameter in Java control panel: 在Java控制面板中设置运行时参数:

    -Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:8000,suspend=y

  • in Eclipse, Run->Debug Configurations ... Choose Remote Java Application from the list. 在Eclipse中, Run->Debug Configurations ...从列表中选择“远程Java应用程序”。 Click on the New launch configuration button in the upper left. 单击左上角的“新启动配置”按钮。 Name the new configuration. 命名新配置。 Change the Connection Type to Standard (Socket Listen). 将连接类型更改为标准(套接字侦听)。 Click on Apply, then Debug. 单击“应用”,然后单击“调试”。

I followed these steps, and in eclipse I got " waiting for vm to co... port 8000... ". 我按照这些步骤操作,在Eclipse中,我得到了“ 正在等待vm连接端口8000 ... ”。

It never ends... I Googled it but couldn't find the resolution. 它永远不会结束...我用Google搜索了它,但是找不到分辨率。

Try the following JVM configuration, 尝试以下JVM配置,

-Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y 

suppose your remote container is running at 192.0.0.0, then you have to add debug parameters to jvm in remote server. 假设您的远程容器运行在192.0.0.0,则必须在远程服务器的jvm中添加调试参数。

-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y

Then in your local machine run eclipse. 然后在您的本地计算机上运行eclipse。 In local machine start eclipse, Run->Debug Configurations... Choose Remote Java Application from the list. 在本地计算机启动eclipse中,运行->调试配置...从列表中选择远程Java应用程序。 Click on the New launch configuration button in the upper left. 单击左上角的“新启动配置”按钮。 Name the new configuration. 命名新配置。 Change the Connection Type to Standard (Socket Listen). 将连接类型更改为标准(套接字侦听)。 Make sure under connection properties you give server host as 192.0.0.0 and port as 8000 and Click on Apply, then Debug. 确保在连接属性下,将服务器主机设置为192.0.0.0,端口设置为8000,然后单击“应用”,然后单击“调试”。

It sounds like both Eclipse and the JVM are each waiting for the other one to connect to it. 听起来Eclipse和JVM都在等待对方连接到它。 I think you need to select Socket Attach in Eclipse, not Socket Listen. 我认为您需要在Eclipse中选择Socket Attach,而不是Socket Listen。

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

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