天天看点

解决 idea tomcat启动项目报错——Unable to open debugger port

问题场景

打开idea准备debug模式启动tomcat项目,却启动失败报错:Unable to open debugger port (127.0.0.1:60157): java.net.SocketException “socket closed”。

问题分析

因为端口被占用导致的。

解决方法

  1. 修改tomcat启动配置,更改出问题的端口值;
    解决 idea tomcat启动项目报错——Unable to open debugger port
    解决 idea tomcat启动项目报错——Unable to open debugger port
  2. 直接将涉及到对应端口的服务给关闭;
    1. windows
      # 找对应的端口
      
      netstat -aon|findstr “1099”
      
      # 干掉对应进程
      
      taskkill -f -pid 15380           
    2. linux
      # 找对应的端口
      
      netstat -tnlp|grep 8080 
      
      # 干掉对应进程
      
      kill 15380