一、异常错误

  • Maven启动tomcat:run时,出现 SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"] 错误
Jun 20, 2022 5:36:45 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 20, 2022 5:36:45 PM org.apache.coyote.AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"]
java.net.BindException: Address already in use: NET_Bind <null>:8080
	at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:407)

二、原因

  • Tomcat 的默认8080端口被占用

三、解决方法

  • cmd输入netstat -ano|findstr 8080,找到占用8080端口的进程
  • 列对应的分别是:协议-本地地址-外部地址-状态-PID
  • 输入taskkill /f /pid PID终止8080端口进程,此例PID为5476,故输入taskkill /f /pid 5476

在这里插入图片描述

  • 或者打开任务管理器,找到PID为5476的进程将其结束

在这里插入图片描述

  • 重新启动tomcat:run,一直转圈但未报出SEVERE: Failed异常,表示tomcat是正常运行的,打开浏览器输入访问地址即可

在这里插入图片描述

在这里插入图片描述

更多推荐