启动一个简单的springboot项目报错:
一、错误原因
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
此行意思是,启动项目时出错,如果想要详细报告,需调试(debug)程序。
description才是详细内容:
Web server failed to start. Port 8080 was already in use.
意思是:Web服务器启动失败,端口8080已被占用。
二、解决方案
下面也给出了具体的解决方案:
Action:
Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.
即有两种解决方案:
一是更改此项目的端口号
1.找到配置文件,若之前配置过,则直接修改port即可,若空白无任何配置,则输入server.port=XXX
XXX是自定义的端口号,端口号默认为8080,此处可以自行修改。(我改成了8888
2.重新启动项目
项目启动成功,且端口号变为8888
二是关闭占用端口的程序
找到端口号对应的程序 关闭该程序
参考文章:
https://blog.youkuaiyun.com/zhouky1993/article/details/103976320