mybatis整合spring时出现如下错误
错误:Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'ssf' while setting bean property 'sqlSessionFactoryBeanName'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ssf' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'ds' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ds' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [${driver}]……
很令人崩溃的 错误,尝试了各种解决方法最后发现写错了一个属性值!!!!!
将ref改成value即可