使用 Eclipse 和 tomcat 进行远程调试

发布于 2024-11-03 13:03:28 字数 490 浏览 0 评论 0原文

我在Linux服务器上部署了一个应用程序,其中一些IP为11.22.33.44

服务器详细信息

Java版本-“1.6.0_14”

IP-11.22.33.44

当我启动服务器时,我在服务器控制台上收到以下o/p '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8004'

这意味着我已经设置了在调试模式下启动服务器所需的所有信息

客户端设置(其他 Windows 7 计算机)

对于 Eclipse 上的连接属性详情如下 主持人:11.22.33.44(如上所述) 端口:8004(如上所述)

我想每件事都正确完成,但仍然出现

无法连接到远程虚拟机。连接被拒绝。连接超时:连接

错误

从运行 Eclipse 的客户端计算机,我能够 ping 通服务器计算机,即 11.22.33.44

I have an application deployed on linux server with some ip say 11.22.33.44

Server Details

Java version - "1.6.0_14"

IP - 11.22.33.44

when i start the server i am getting the following o/p on server console
'-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8004'

This means i had set all the required information for starting the server in debug mode

Client side Setting (Other windows 7 machine)

For connection properties on eclipse the details are as follows
Host : 11.22.33.44 (As above)
Port : 8004 (As above)

I guess every thing is done correctly but still getting the

Failed to connect to remote VM. Connection refused.Connection timed out: connect

error

From my client machine where eclipse is running i am able to ping the server machine i.e. 11.22.33.44

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

那些过往 2024-11-10 13:03:28

听起来像是防火墙问题。
您可以从给定机器/端口上的命令行进行telnet吗?
尝试一下:

telnet 11.22.33.44 8004

如果失败,则意味着您的端口未打开 - 要么您的 JVM 忽略了参数并且没有侦听该端口,要么有防火墙阻止您的访问。
为了识别它是哪一个,您可以登录到运行 tomcat 的计算机,

telnet localhost 8004

如果成功,则意味着您的 jvm 正在该端口上接受远程调试连接,因此问题出在您网络中的防火墙,如果失败则意味着您尚未使用正确的远程调试参数启动 JVM。

sounds like a firewall issue.
Can you telnet from the command line on the given machine / port?
Try this:

telnet 11.22.33.44 8004

if this fails then it means your port is not open -- either your JVM ignored the parameters and is not listening on that port or there is a firewall blocking your access.
In order to identify which one it is, you can log onto the machine running tomcat and

telnet localhost 8004

if this succeeds it means your jvm is accepting remote debug connections on that port and therefore the problem is a firewall in your network, if it fails it means you haven't started the JVM with the correct remote debug params.

拍不死你 2024-11-10 13:03:28

检查以下内容后,发现另一个错误源:连接类型。因此,对于其他遇到相同问题的人,应遵循以下问题解决路径:

  1. Ping 托管应用程序的主机(服务器)。如果不成功,请检查您的 NIC 的一侧是否与目标主机位于同一网络中 - 如果使用 IP 而不是主机。
  2. 远程登录您的主机。例如 telnet 192.168.0.2 8889 。如果您可以很快连接,那就没问题了。看到连接被拒绝消息表示没有成功。不过“连接被外国主机关闭”没问题。
  3. 现在打开 Eclipse 并创建远程调试配置。输入您之前远程登录的同一主机和端口。选择连接类型“标准(套接字连接)”。 注意,如果您在选择框中看到两个相同的实例,请尝试两个。有时其中之一不起作用。

这应该可以做到。如果没有,请留言,我帮忙。

After checking the following there is another source of error: Connection Type. So for others having the same issue, shall follow this problem resolution path:

  1. Ping the host that hosts your application (server). If not successful, check that you have one leg of your NIC in the same network as your target host - if working with IPs instead of hosts.
  2. telnet your host. e.g. telnet 192.168.0.2 8889 . If you can connect shortly, then that is fine. Seeing connection refused message is no success. "Connection closed by foreign host" is fine though.
  3. Now open Eclipse and create a Remote Debugging Configuration. Enter the same host and port that you previously telneted. Select Connection Type "Standard (Socket Attach)". Caution, if you see two of this same instance in the selection box, try both. Sometime one of these does NOT work.

This should do it. If not, drop a message and I help out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文