端口被占用或提示如下报错信息:
【报错信息1】
Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/db/db.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [config/db/db.xml]: Invocation of init method failed; nested exception is java.sql.SQLException: interrupt
【报错信息2】The Tomcat connector configured to listen on port 8080 failed to start...
(1)搜索框输入cmd打开命令提示符,输入命令netstat -aon|findstr "端口号"查询被占用端口的进程号
netstat -aon|findstr "8080"
(2)找到端口号对应的pid,使用命令taskkill /pid XXXX /f终止该进程
taskkill /pid XXXX /f
最后重启项目即可