问题场景
打开idea准备debug模式启动tomcat项目,却启动失败报错:Unable to open debugger port (127.0.0.1:60157): java.net.SocketException “socket closed”。
问题分析
因为端口被占用导致的。
解决方法
- 修改tomcat启动配置,更改出问题的端口值;
直接将涉及到对应端口的服务给关闭;
windows
# 找对应的端口 netstat -aon|findstr “1099” # 干掉对应进程 taskkill -f -pid 15380
linux
# 找对应的端口 netstat -tnlp|grep 8080 # 干掉对应进程 kill 15380