org.apache.ibatis.binding.BindingException: Type interface com.lgl.dao.UserDao is not known to the MapperRegistry. 报错问题解决
错误原因在Mybatis的核心配置文件中少了mapper.xml文件注册!
MapperRegistry是什么?
核心配置文件中注册mapper
<!--每一个Mapper.XML都需要在Mybatis核心配置文件中注册!-->
<mappers>
<mapper resource="com/lgl/dao/UserMapper.xml"/>
</mappers>