我正在编写一个小型java项目,它将把网球运动员的数据插入数据库。但是,我收到此错误:
2023-02-25T15:52:06.800-05:00 ERROR 16196 --- [ main] com.zaxxer.hikari.HikariConfig : Failed to load driver class org.h2.Driver from HikariConfig class classloader jdk.internal.loader.ClassLoaders$AppClassLoader@4d7e1886
Run Code Online (Sandbox Code Playgroud)
这导致了这个错误:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Unsatisfied dependency expressed through method 'dataSourceScriptDatabaseInitializer' 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 load driver class org.h2.Driver in either of HikariConfig class loader or Thread context …Run Code Online (Sandbox Code Playgroud)