Failed to determine a suitable driver class
See original GitHub issueSpring Boot Version: 2.0.3.RELEASE
application.properties
###--- Database ---###
spring.datasource.url = jdbc:mysql://localhost:3306/mydb
spring.datasource.username = root
spring.datasource.password = password
spring.datasource.platform = mysql
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto = create
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
Pom.xml contains
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
...
<!-- Database dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
When I run my application, I get following error
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-07-17 12:31:12.528 ERROR 15387 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
After searching for a bit, I found that if I use earlier versions like 1.5.13.RELEASE this doesn’t happen.
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (4 by maintainers)
Top Results From Across the Web
Resolving Failed to Configure a DataSource Error - Baeldung
Learn what causes the Spring Boot error "Failed to configure a DataSource" and how ... Reason: Failed to determine a suitable driver class...
Read more >Springboot postgres Failed to determine a suitable driver class
I am trying to develop web application using SpringBoot and Postgres Database. However, on connecting to the application, I am getting error " ......
Read more >Failed to configure a DataSource: 'url' attribute is ... - Yawin Tutor
Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please...
Read more >Solving the error Failed to auto-configure a DataSource
This tutorial will help you to solve the error Failed to auto-configure a ... Reason: Failed to determine a suitable driver class.
Read more >Spring Boot - Cannot determine embedded database driver ...
Cannot determine embedded database driver class for database type NONE ... This error comes when you don't have a DataSource configured for your ......
Read more >
Top Related Medium Post
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top Related StackOverflow Question
Apologies for replying late, I was not able to isolate the issue but now I did and came here to give the solution.
My application organization looked like below
Commonswas a parent toModule1.I had created a
BaseEntityhaving JPA annotations in my commons module. Thecommonsdependency was specified asOnce I added the
<scope>provided</scope>The issue got resolved for me. Unfortunately, I’m not able to do further analysis nor I can share the code.
I got the same problem with spring-boot 2.1.3 RELEASE. I marked my project with
<packaging>pom</packaging>(stupid) so It didn’t work, removing this resolved my issue.