0

I getting this error while executing spring boot application

Cannot determine embedded database driver class for database type NONE Action: If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

Jaap
  • 81,064
  • 34
  • 182
  • 193
ravindra
  • 1
  • 1
  • 1

1 Answers1

0

Spring Boot tries to auto-configure your database connection and you provided no connection information. So, Spring Boot tries to look for embedded db drivers (like H2 or HSQLDB) and fails because you have not included any of theses drivers.

You have three solutions:

  1. You do not need a relational database: remove Hibernate, spring-boot-starter-jpa, etc. from your classpath (Maven POM or Gradle).

  2. You just want to test local stuff with an in-memory db: add H2 to your classpath. For Maven add this to pom.xml in the dependencies section:

    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
    </dependency>
    
  3. Add a database driver to your classpath and add the connection information to your application.properties

    spring.datasource.url = …
    spring.datasource.driver-class-name = …
    spring.datasource.username = …
    spring.datasource.password = …
    
derkoe
  • 5,649
  • 2
  • 23
  • 31
  • I have the same problem as in the main question, however, my problem appears only when I "Debug" the project. i.e it works fine when I do "Run" it. do you have any idea? I already set the database driver and connection info in .properties file. – Mgeed Oct 22 '18 at 09:36