1. 程式人生 > >解決新建springboot專案啟動報錯問題

解決新建springboot專案啟動報錯問題

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

在這裡插入圖片描述

參考了網上很多方法,發現報這個錯的原因不止一個,最後也是奇怪的解決了。

推薦方法(不適用與所有人):
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、啟動專案

在這裡插入圖片描述 在這裡插入圖片描述

噹噹噹當 啟動成功