- org.apache.ibatis.binding.BindingException: Type interface com.mybatis.demo.dao.UserDao is not known to the MapperRegistry.
解释:在MapperRegistry中未找到这个接口UserDao
解决:只需要在MapperRegistry注册相对应的接口
<!--mappers 元素包含了一组映射器(mapper)-->
<mappers>
<mapper resource="com.mybatis.demo.dao.UserMapper.xml"/>
</mappers>
以上也可以直接添加对应的扫描器