Mybatis报错:Type interface com.mycode.dao.UserMapper is not known to the MapperRegistry.

问题描述:
MapperRegistry不知道 com.mycode.dao.UserMapper这个接口。
Mybatis报错:Type interface com.mycode.dao.UserMapper is not known to the MapperRegistry.
解决思路:
Mybatis报错:Type interface com.mycode.dao.UserMapper is not known to the MapperRegistry.
以上图示代码首先是读取核心配置文件(SqlMapConfig.xml),得到一个输入流,构造者根据输入流流构造一个工厂,工厂生产一个SqlSession对象,SqlSession对象得到映射器的代理对象(有接口,没有实现类,生成代理对象),由代理对象执行sql语句。而报错是MapperRegistry不知道 com.mycode.dao.UserMapper这个接口,所有先看一下映射配置文件(UserMapper.xml)中namespace属性,namespace属性是规定给那个接口配置的映射。
Mybatis报错:Type interface com.mycode.dao.UserMapper is not known to the MapperRegistry.
这是就发现了问题。。。。写习惯了Dao,这里的接口名写错了