我需要远程调试我的应用程序,但由于以下错误,我无法调试:
Unable to open debugger port (X.X.X.X:8000): java.net.ConnectException "Connection timed out: connect"
我有:
我得出的结论是,造成问题的原因是用于远程调试的端口8000无法通过外部ip访问,只能通过‘localhost’访问。的原因如下,我认为是这样的原因:
远程调试正在运行预期的端口:
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进行拨号:
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
下面是iptable的输出:
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端口来解决这个问题?或者我的主要问题还有其他原因?
发布于 2019-10-29 10:30:25
尝试使用"iptables“来解除防火墙的阻塞。
https://stackoverflow.com/questions/34480048
复制相似问题