Spring Boot error: Cannot determine embedded database driver class for database type NONE

Source: Internet
Author: User

Error Reason: Spring Boot defaults to loading the Org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration class, and the Datasourceautoconfiguration class uses the The @Configuration annotation injects the DataSource bean into spring. Because there is no configuration information related to datasource in the project, the spring creation DataSource Bean will be error-free due to lack of relevant information.

Workaround: 

1. Add @enableautoconfiguration (Exclude={datasourceautoconfiguration.class}) to the application class to block the spring Boot auto-inject datasource bean

2. Increase database configuration related information



Springboot's Freemarker:

Create the Springboot project and add the Freemarker jar package to the POM



Write the relevant code in the controller layer and upload the information to the specified. ftl file,



Get the information out of the. FTL


Start, run normally!



Spring Boot error: Cannot determine embedded database driver class for database type NONE

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.