spring整合mybatis遇到的bug java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

出bug的原因:mybatis-spring版本问题。
查看SqlSessionDaoSupport源码
 
1.2以上的版本:
 
1.1.1版本:
解决方法:1.2版本移除了@Autowired的注解,所以如果是1.2版本以上,要在BaseDaoImpl里面手动
注入SetSessionTemplate或者SetSessionFactory

 

posted @ 2017-09-15 20:51  gitqiy  阅读(578)  评论(0编辑  收藏  举报