Saturday 14 October 2017

Three ways solving Spring Boot Cannot determine embedded database driver class for database type NONE

If you don’t have a DataSource configured for your spring boot application, when you run spring boot application, it tries to configure the DataSource and throws this error message when there is no configuration provided.

We have three ways to slove this:

1) If you don't need any data source, just exclude it as below:


@SpringBootApplication
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
public class SpringBootDemoApplication { }
2) If you need ds just for test purpose, say using an embedded DB like HSqldb, just add the dependency in your pom or yml file:
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>


3) Or you want to have your own external DB configuration, you need to provided DS information in spring boot configuration file, generally add below into application.properties is fine:
spring.datasource.url=xxx
spring.datasource.* is the default prefix for spring boot data source configuration, if you use other prefix, you may need add your own ds configuration file.

4 comments:

  1. I want to applaud my beautiful wife for finding out about Dr Ozigidon who helped us with the National Lottery Jackpot winning numbers to win a whopping sum of £184 Million in the Euro-million win. My name is Joe Thwaite, 49, and my wife is Jess Thwaite, 46, from Gloucestershire. On May 10, 2022 we became the biggest national lottery jackpot winner after we had contacted Dr Ozigidon to help us become a large winner in the lottery with his powerful spell because my wife and I have read a lot about his powerful and effective spell. He gave us the winning numbers after casting the spell and assured us of victory. We followed and obeyed Dr Ozigidon spell instructions and today we are celebrating after winning the record-breaking Euro-Millions jackpot of £184M from the draw on Tuesday 10 May, 2022. Thanks to Dr Ozigidon because his good work has really been wonderful with his magical spells. We usually play the lottery but coming up with a big win has never been our thing not until we came in contact with Dr Ozigidon who a lot of people have been so thankful to for his miraculous doings. We are so grateful to this power sorcerer Dr Ozigidon. For giving us victory with his powerful spell. We decided to go public to motivate others and also to tell everyone about Dr Ozigidon powerful spell. Contact him today if you wish. His email: drozigidonhenz.spell.net@gmail.com ]. We need extraordinary confidence to make things happen magically in our lives.

    ReplyDelete