Java 使用 jboss 进行 Eclipse 远程调试
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18182666/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse Remote debugging with jboss
提问by Ravi
How can I configure remote debugging in Eclipse with JBOSS server 4.x version?
如何使用 JBOSS 服务器 4.x 版本在 Eclipse 中配置远程调试?
So far,
迄今为止,
Step1: I have modified the run.confg file. By uncommenting the below line. Sample JPDA settings for remote socket debugging:
步骤 1:我修改了 run.confg 文件。通过取消注释以下行。用于远程套接字调试的 JPDA 设置示例:
JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
Step2: Then I configured Eclipse in debug configurations. It's saying:
Step2:然后我在调试配置中配置了Eclipse。是说:
Failed to connect to remote VM. Connection refused.
回答by Alexander Rühl
What you are asking is not specific to either Java EE or JBoss 4.x - you can debug any Java process in case you specified the remote debugging runtime parameters when starting the JVM.
您要问的不是 Java EE 或 JBoss 4.x 特有的 - 如果您在启动 JVM 时指定了远程调试运行时参数,您可以调试任何 Java 进程。
In your setting the -Xdebug
parameter is missing, so your line would be:
在您的设置-Xdebug
中缺少参数,因此您的行将是:
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
Now it should be able to connect, in case you are using the correct host and your specified port 8787. In case it's still not working, it's most likely a firewall issue blocking the port.
现在它应该能够连接,以防您使用正确的主机和指定的端口 8787。如果它仍然无法工作,很可能是防火墙问题阻止了端口。