You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot应用部署Linux环境时出现Failed to determine a suitable driver class错误的排查求助

Spring Boot应用部署Linux环境时出现Failed to determine a suitable driver class错误的排查求助

我使用的Spring Boot版本是3.4.1,在IntelliJ IDE中运行应用一切正常,但尝试部署到Linux环境时遇到了如下错误:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'dataSource' defined in class path resource [org/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

我的配置文件内容如下:

spring.datasource.url=jdbc:mariadb://localhost:3306/database
spring.datasource.username=username
spring.datasource.password=password
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver

pom.xml中的相关依赖配置:

<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
</dependency>

请问我哪里遗漏了?谢谢!

备注:内容来源于stack exchange,提问作者user30091549

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.13 19:49:35