admin管理员组文章数量:1356842
My Spring Boot version is 3.4.1 While running from IDE (IntelliJ) everything looks fine. Getting a below-mentioned error while trying to deploy the application on Linux :
.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'dataSource' defined in class path resource [/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: Failed to determine a suitable driver class
In my properties file :
spring.datasource.url=jdbc:mariadb://localhost:3306/database
spring.datasource.username=username
spring.datasource.password=password
spring.datasource.driver-class-name=.mariadb.jdbc.Driver
In my pom :
<dependency>
<groupId>.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
</dependency>
What have I miss ? Thx
My Spring Boot version is 3.4.1 While running from IDE (IntelliJ) everything looks fine. Getting a below-mentioned error while trying to deploy the application on Linux :
.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'dataSource' defined in class path resource [/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: Failed to determine a suitable driver class
In my properties file :
spring.datasource.url=jdbc:mariadb://localhost:3306/database
spring.datasource.username=username
spring.datasource.password=password
spring.datasource.driver-class-name=.mariadb.jdbc.Driver
In my pom :
<dependency>
<groupId>.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
</dependency>
What have I miss ? Thx
Share Improve this question edited Mar 28 at 10:56 user30091549 asked Mar 28 at 10:54 user30091549user30091549 11 bronze badge 2 |1 Answer
Reset to default 0The version of spring boot you are using need to have a compatible maria db driver considering the scope mentioned is runtime,still check for that spring boot version which maria db version driver class is compatible,then specify that driver class name,also check in your local whether the mariadb is being connected with the specified spring boot's application.properties details
本文标签: javaSpring boot applicationFailed to determine a suitable driver classStack Overflow
版权声明:本文标题:java - Spring boot application - Failed to determine a suitable driver class - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744042126a2580855.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
Class.forName(".mariadb.jdbc.Driver")
? – lance-java Commented Mar 28 at 11:05spring.datasource.driver-class-name=.mariadb.jdbc.Driver
and let SpringBoot determine it – asgarov1 Commented Mar 28 at 11:17