搭建springboot+mybatis +h2项目时,启动后出现Cannot load JDBC driver class 问题,找了许久,应该时版本问题,于是修改h2依赖,发现可用,在此mark。
<!-- <dependency>-->
<!-- <groupId>com.h2database</groupId>-->
<!-- <artifactId>h2</artifactId>-->
<!-- <version>1.4.199</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
本文记录了一次在搭建SpringBoot结合MyBatis和H2数据库项目的经历中,遇到的“Cannot load JDBC driver class”错误。通过调整H2依赖版本,成功解决了启动时的驱动加载问题。
2669





