Could not load driverClass ${jdbc.driverClassName}

在springmvc整合mybatis3时一直遇到
Could not load driverClass ${jdbc.driverClassName}
将 ${jdbc.driverClassName} 改成具体的值就不会报错,多番查询资料发现本来就是mybatis的一个已有的问题:https://code.google.com/p/mybatis/issues/detail?id=414

解决问题的办法:
删除spring配置文件的default-autowire="byName"
若是多数据源的话,在自动扫描那里改用sqlSessionFactoryBeanName
如:
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="xxxxxxxx" />
<property name="sqlSessionTemplateBeanName" value="xxxxxxx" />
</bean> 

猜你喜欢

转载自huangsky.iteye.com/blog/2044345
今日推荐