Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userDao’ defined in URL [jar:file:/C:/MAVEN/maven_repository/maven_repository/com/itheima/ssm_test/ssm_work_dao/1.0-SNAPSHOT/ssm_work_dao-1.0-SNAPSHOT.jar!/com/itheima/ssmwork/dao/UserDao.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property ‘sqlSessionFactory’ or ‘sqlSessionTemplate’ are required
今天做案例的时候发现提示sqlSessionFactroy错误,后发现为applicationContext中 没有配置
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
</bean>