目录
1.修改JDBC版本
在Spring实战第五版第三章中使用内置H2数据库存取数据,但是添加之后项目启动报错:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-12-01 15:21:46.641 ERROR 33768 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration$JdbcTransactionManagerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.jdbc.datasource.DataSourceTransactionManager]: Factory method 'transactionManager' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/support/JdbcTransactionManager
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.12.jar:5.3.12]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.12.jar:5.3.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCap