1. 程式人生 > >spring整合mybatis遇到的bug java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

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

如果 spring tis per div prop seda bat required

出bug的原因:mybatis-spring版本問題。 查看SqlSessionDaoSupport源碼 1.2以上的版本: 技術分享 1.1.1版本: 技術分享 解決方法:1.2版本移除了@Autowired的註解,所以如果是1.2版本以上,要在BaseDaoImpl裏面手動 註入SetSessionTemplate或者SetSessionFactory 技術分享

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