Problem Description:
after the first day of work, daily operation Open idea prepare debug mode start Tomcat project, but start failure error: Unable to open debugger port (127.0.0.1:60157): Java.net.SocketException "Socket closed". Reason analysis:
This error occurs because the port is occupied. Workaround:
There are two main solutions: Modifying the port configuration (recommended), and shutting down the port-consuming process (not recommended). Mode One: Modify port configuration (recommended)
The port you are using may be a local port, or it may be a JMX port or a port in debug mode, configuring the port location as shown in the figure, and starting Tomcat without an error if you try to modify it.
mode two: Shutting down the port-consuming process (not recommended)
Locate the process that occupies the port and close it, but this method may cause a useful process to be forcibly shut down, so it is not recommended.
The first step: cmd Open the command Line window, execute the command: Netstat-aon|findstr "1099" to find the process that occupies the port.
Step two: According to the PID, continue to execute the command: Taskkill-f-pid 15380 Closes the process.
Solve the problem.