problem
When you select a data source for a project framework that is automatically generated by springboot, such as by selecting MySQL, the startup will report an exception after the project is built:
Description:
cannot determine embedded database driver class for database type NONE
Action:
If your want an EMB edded database Please put a supported one on the classpath. If you are have database settings to is loaded from a particular profiles you'll need to active it (no profiles are currently Active).
Problem Analysis
This problem occurs because a springboot-generated project is automatically injected into the data source when it is started. When the data source information is not configured in the configuration file, an exception is thrown. Solution
(1) If you do not need a data source for the time being, you can comment out the MySQL and MyBatis (or other data source framework) in the Pom file to start normally.
(2) excluding its injection in @springbootapplication
@SpringBootApplication (Exclude={datasourceautoconfiguration.class,hibernatejpaautoconfiguration.class})
(3) Provide the configuration of the data source or other data source configuration, here provide the default configuration example, add the following configuration items in the Application.properties file:
# the primary data source, the default #spring. Datasource.type=com.zaxxer.hikari.hikaridatasource
Spring.datasource.driverclassname=com.mysql.jdbc.driver Spring.datasource.url=jdbc:mysql://localhost:3306/test Spring.datasource.username=root Spring.datasource.password=root