Eclipse:无法连接到远程VM。连接被拒绝。 [英] Eclipse : Failed to connect to remote VM. Connection refused.

查看:5314
本文介绍了Eclipse:无法连接到远程VM。连接被拒绝。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图启动我的eclipse调试(对于服务器端代码),我得到以下错误无法连接到远程VM。连接被拒绝。



问题可能是什么?我已经尝试了大部分的解决方案在网上,但没有解决我的问题。任何人都可以帮助我解决这个问题?




解决方案

就像已经说过:


  1. 在您的调试配置中,您必须定义服务器的正确端口(GF:9009 / Tomcat:8000 )

  2. 您必须将服务器的JVM属性设置为 debug

对于Glassfish:

 登录admin-console&配置> server-config> JVM设置>检查DEBUG复选框>重新启动服务器

对于Tomcat:



%TOMCAT_HOME%/ bin 目录中写入 debug.bat / .sh (取决于您的操作系统) p>

  set JPDA_ADDRESS = 8000 
set JPDA_TRANSPORT = dt_socket
catalina.bat jpda start





执行debug.bat / .sh。



现在,您应该能够在调试配置中设置必要的属性后在Eclipse中远程调试。



希望这有帮助!有乐趣!



编辑



如果您在Win环境作为服务不要在tomcat安装的 bin 目录中有一个 catalina.bat 文件。

要将服务器设置为调试模式,请尝试以下操作:


  1. 在Windows菜单中运行配置选项或运行%catalina_home%/ bin / tomcat6w.exe

  2. 在Java选项卡中,将此行添加到Java:




选项:-Xrunjdwp:transport = dt_socket,address = 8000,server = y,suspend = n



When ever i tried to launch my eclipse debug(for server side code) i'm getting the following error Failed to connect to remote VM. Connection refused.

What's the problem may be? I already tried with most of the solutions out in the web but none of that solved my issue. Could any one can assist me to fix this? Advance thanks..

解决方案

Which server are you using?

Like already said:

  1. In your debug configuration you'll have to define the right port of your server (GF:9009 / Tomcat:8000)
  2. You'll have to set the JVM property of the server to debug

For Glassfish:

    Log in to admin-console > Configurations > server-config > JVM-Settings > check DEBUG checkbox > restart server

For Tomcat:

create file debug.bat/.sh (depending on your OS) in %TOMCAT_HOME%/bin directory and write

    set JPDA_ADDRESS=8000
    set JPDA_TRANSPORT=dt_socket
    catalina.bat jpda start

in it.

After you've created this file start server by executing debug.bat/.sh.

Now you should be able to debug remotely in Eclipse after you set the necessary properties in your debug configuration.

Hope this helped! Have Fun!

EDIT

If you're running tomcat in a Win environment as a service you don't have a catalina.bat file in the bin-directory of your tomcat installation.
To set your server into debug-mode please try the following:

  1. Run the Configuration option in Windows Menu or run %catalina_home%/bin/tomcat6w.exe
  2. In Java tab, add this line to Java:

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

这篇关于Eclipse:无法连接到远程VM。连接被拒绝。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆