Unable to debug app remotely - port isn#39;t accessible externally(无法远程调试应用程序-无法从外部访问端口)
问题描述
我需要远程调试我的应用程序,但由于以下错误,我无法执行此操作:
我有: 我得出的结论是,问题的原因是用于远程调试的端口8000无法通过外部IP访问,只能通过‘localhost’访问。以下是我认为是这样的原因: 远程调试正在预期的端口上进行: 我能够通过‘localhost’远程登录到它: 但无法通过外部IP远程登录: 以下是ipables的输出:Unable to open debugger port (X.X.X.X:8000): java.net.ConnectException "Connection timed out: connect"
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
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.
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
如何使用8000端口解决此问题?或者我的主要问题可能有其他原因?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
推荐答案
这是为我完成任务的命令:
sudo ufw allow <debug_port>
这篇关于无法远程调试应用程序-无法从外部访问端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法远程调试应用程序-无法从外部访问端口


基础教程推荐
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 降序排序:Java Map 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01