最近在学习整合Spring与MyBatis时,出现了以下异常:
Error creating bean with name 'sqlSessionFactoryBean' defined in class path resource [application-mybatis.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException;
Property 'dataSource' threw exception; nested exception is java.lang.NoClassDefFoundError
如果你的配置文件仔细检查之后都没有问题的话,那么这就是因为项目中缺少依赖包spring-jdbc-5.0.8.RELEASE.jar(任意版本皆可),导入到项目中即可。
附上下载地址(Spring所有依赖包、与MyBatis整合所需要的所有依赖包)