This afternoon when I started Spring cloud microservices, I reported this error:
Error starting ApplicationContext. To display the Auto-configuration report re-run your application with ' debug ' enabled.
2018-07-03 20:17:10.295 ERROR 19024---[main] o.s.b.d.loggingfailureanalysisreporter:
***************************
Application FAILED to START
***************************
Description:
Cannot determine embedded database driver class for database type NONE
Action:
If you want a embedded database, put a supported one on the classpath. If you have the database settings to is loaded from a particular profiles you may need to active it (no profiles is currently Active).
Disconnected from the target VM, address: ' 127.0.0.1:55393 ', Transport: ' Socket '
Process finished with exit code 1
At first I thought the port was occupied. Decisive cmd and input netstat-aon, looking for half a day did not find the port occupied, and then looked on the internet a bit,
Transferred from: 78190703?locationnum=9&fps=1
Springboot Start Error: Cannot determine embedded database driver class for database type NONE
Springboot automatically injects data sources and configures JPA at startup
Workaround One: Add annotations to the Startup class: @SpringBootApplication (Exclude={datasourceautoconfiguration.class, Hibernatejpaautoconfiguration.class})Workaround Two: Configure the data source within the Application.properties file. The code is as follows:
Spring.datasource.url=jdbc:mysql://localhost:3306/testspring.datasource.username= Rootspring.datasource.password=123456spring.datasource.driver-class-name= com.mysql.jdbc.driverspring.datasource.max-idle=10spring.datasource.max-wait=10000spring.datasource.min-idle= 5spring.datasource.initial-size=5
I carefully examined, also added the annotation, tried, I, useless ah, life, is really not bedug,
Had to use the ultimate trick, copy my own code, delete the project, update the project from new SVN, import run, hey yo I go. Why is that still the problem? Is it my project configuration problem? No, my other projects are fine. Helpless, had to turn to the small bowl (a serious work of the Big Guy);
Spring Cloud Micro Service startup error (1)