No qualifying bean of type 'org.apache.ibatis.session.SqlSession' available
1、可能是SqlSessionFactoryBean配置错误
<bean id="mySqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<!-- 自动扫描mapping.xml文件 -->
<property name="mapperLocations" value="classpath:com/ssm/mapper/*.xml"></property>
</bean>
2、可能UserDao注入SqlSessionFactoryBean错误
<!-- DAO接口所在包名,Spring会自动查找其下的类 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.ssm.dao" />
<property name="sqlSessionFactoryBeanName" value="mySqlSessionFactory"></property>
</bean>