无法远程调试应用程序-端口无法从外部访问

问题描述 投票:3回答:1

我需要远程调试我的应用程序,但是由于以下错误,我无法做到这一点:

Unable to open debugger port (X.X.X.X:8000): java.net.ConnectException "Connection timed out: connect"

我有:

  1. 在远程服务器(Debian)上的Tomcat中运行的Java应用程序
  2. IntelliJ Idea在本地运行(Windows)

我得出的结论是,问题原因是用于远程调试的端口8000只能通过'localhost'不能通过外部ip访问。以下是原因,我为什么这么认为:

远程调试正在预期的端口上进行:

root@victor-app-server:/opt/tomcat-home/bin# netstat -tulpn | grep 8000
tcp  0  0  0.0.0.0:8000  0.0.0.0:*  LISTEN  3773/java

我能够通过'localhost'远程登录到它:

root@victor-app-server:/opt/tomcat-home/bin# telnet localhost 8000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

但无法通过外部IP进行telnet:

root@victor-app-server:/opt/tomcat-home/bin# telnet X.X.X.X 8000
Trying X.X.X.X...
telnet: Unable to connect to remote host: Connection timed out

这里是iptables的输出:

root@victor-app-server:/opt/tomcat-home/bin# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

如何使用8000端口解决此问题?也许是我的主要问题还有其他原因?

java linux tomcat intellij-idea remote-debugging
1个回答
0
投票

尝试使用“ iptables -F”来解除防火墙的阻塞

© www.soinside.com 2019 - 2024. All rights reserved.