解决新建springboot项目启动报错问题

Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled.

解决新建springboot项目启动报错问题

参考了网上很多方法,发现报这个错的原因不止一个,最后也是奇怪的解决了。

推荐方法(不适用与所有人):
1、先在application.properties 写好数据库配置

	//这是我的
	spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test
	spring.datasource.username=root
	spring.datasource.password=root
	spring.datasource.driver-class-name=com.mysql.jdbc.Driver
	spring.datasource.max-idle=10
	spring.datasource.max-wait=10000
	spring.datasource.min-idle=5
	spring.datasource.initial-size=5

2、清理项目缓存

	//我这里用的是IDEA
	 点击File -> Invalidate caches -> Invalidate 
	 
3、清理8080端口

	win + R		输入cmd		回车
	netstat -ano | findstr 8080	回车
	taskkill  -pid  进程id  -f

4、启动项目

解决新建springboot项目启动报错问题
解决新建springboot项目启动报错问题

当当当当 启动成功