异常

运行启动SpringBoot项目报错:

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2021-06-13 22:47:32.704 ERROR 79648 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 80 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 80, or configure this application to listen on another port.

原因

80端口被占用了,如果是其他数字那么表示该端口被占用了,导致无法启动项目成功。

解决

第一种,修改端口号,不使用80端口,而使用其他端口号,比如使用81端口,修改springboot的配置文件application.yml即可

第二种,但我们一定要使用80端口怎么办,杀死占用了80端口的进程。

打开DOS窗口,执行netstat -aon|findstr 80命令查看是什么占用了80端口,蓝色框内就是占用进程的ID号,记住

然后执行taskkill /pid 4 /f关闭这个进程,其中4就是上面的进程ID

如果关闭该进程失败,解决可以参考:nginx: [emerg] bind() to 0.0.0.0:80 failed

再度查看就能发现关闭成功了

再度重启项目就能使用80端口访问了

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐