org.apache.ibatis.binding.BindingException: Type interface xxx is not known to the MapperRegistry
绑定异常:MapperRegistry不知道接口类型xxx
主要的原因,还是出在了没有对mapper进行绑定的问题上
那么只需要添加上对应位置的Mapper.xml就可以了。例:
<mappers>
<mapper resource="com/baven/mapper/StudentMapper.xml"/>
</mappers>
当然,也可以用<mapper class="com.baven.mapper.StduentMapper"
的方式。
前提要注意:XML文件需要和接口在同一个包下,要不也会报错下方错误
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): xxx.xxx.xxXXX
出了这个错误,那么就要注意刚才说的,XML文件需要和接口在同一个包下。
有什么问题大佬可以留言,小弟立刻修改。