tomcat启动没有问题,访问localhost后包错,很有可能是jar包的冲突。
Tomcat启动错误(80端口被占用)的处理方法
错误描述:
2012-2-23 17:11:31 org.apache.coyote.http11.Http11BaseProtocol start
严重: Error starting endpoint
java.net.BindException: Address already in use: JVM_Bind:80
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:298)
at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java:313)
at org.apache.coyote.http11.Http11BaseProtocol.start(Http11BaseProtocol.java:151)
at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:76)
at org.apache.catalina.connector.Connector.start(Connector.java:1090)
at org.apache.catalina.core.StandardService.start(StandardService.java:457)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
2012-2-23 17:11:31 org.apache.catalina.startup.Catalina start
严重: Catalina.start:
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.net.BindException: Address already in use: JVM_Bind:80
at org.apache.catalina.connector.Connector.start(Connector.java:1097)
at org.apache.catalina.core.StandardService.start(StandardService.java:457)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
2012-2-23 17:11:31 org.apache.catalina.startup.Catalina start
信息: Server startup in 6980 ms
关键信息:
java.net.BindException: Address already in use: JVM_Bind:80
错误原因:
80端口被其他的应用占用!
解决方案:
第一步,命令提示符号,执行命令:netstat –ano
Active Connections
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 812
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 812
可见,占用80端口的进程的PID是812
第二步,命令提示符号,执行命令:tasklist
映像名称 PID 会话名 会话# 内存使用
========================= ======== ================ =========== ============
httpd 812 Console 0 5,899K
可见,该占用80端口的进程是httpd
第三步,通过任务管理器,终止进程httpd
第四步,重新启动tomcat,即可正常启动