80端口占用异常解决方法java.net.BindException: Address already in use: JVM_Bind:80(或8080)
1:Tomcat(或其他Web容器)启动时控制台报错如下示:
2007-8-2 15:20:43 org.apache.coyote.http11.Http11Protocol init
严重: Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8080
2007-8-2 15:20:43 org.apache.catalina.startup.Catalina load
严重: Catalina.start
LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind:80
2007-8-2 15:20:46 org.apache.coyote.http11.Http11Protocol start
严重: Error starting endpointjava.net.BindException: Address already in use: JVM_Bind:80
2007-8-2 15:20:46 org.apache.catalina.startup.Catalina start
严重: Catalina.start:
LifecycleException: Protocol handler start failed: java.net.BindException: Address already in use: JVM_Bind:8080
2007-8-2 15:20:46 org.apache.catalina.startup.Catalina start
信息: Server startup in 2922 ms
这说明80端口(该端口是Tomcat的监听端口)已经被其他程序占用,先用命令提示符 " netstat -ano " 命令显示端口状态,再在结果中找到端口,然后根据其 PID 在输入 “ tasklist ” 命令显示中查找其对应程序,就可知道其程序名,进而查明程序的来源,采取适当的措施。
方法可以采用如下:
用netstat -ano 命令结果:
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 2544
TCP 0.0.0.0:100 0.0.0.0:0 LISTENING 2544
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 1404
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:1110 0.0.0.0:0 LISTENING 228
TCP 127.0.0.1:1025 0.0.0.0:0 LISTENING 1052
TCP 127.0.0.1:1159 127.0.0.1:1110 CLOSE_WAIT 2992
TCP 127.0.0.1:1297 127.0.0.1:1110 CLOSE_WAIT 2992
TCP 127.0.0.1:1324 127.0.0.1:1110 CLOSE_WAIT 2992
可见80端口被PID 为2544的进程占用了。
用tasklist 命令:
图像名 PID 会话名 会话# 内存使用
========================= ====== ================ ======== ============
System Idle Process 0 Console 0 28 K
System 4 Console 0 264 K
WebThunder.exe 2544 Console 0 12,120 K
java.exe 2884 Console 0 6,296 K
tasklist.exe 3464 Console 0 4,372 K
可见2544是WebThunder.exe进程。将其关闭。重启TOMCAT。OK!
我用这种方法查得是一个python.exe的进程占用了端口继而查到原来是plone程序占用了8080端口。于是关闭即可。