关于错误:
关键行:Type interface com.zhang.mapper.StudentMapper is already known to the MapperRegistry.
关键行:Invalid bound statement (not found)
解决:
1.在使用SqlMapConfig.xml进行配置Mybatis 时,如果xxMapper类和xxMapper.xml不在同一路径下,则需要使用resource方式进行注册,并且只注册xml文件。
<mappers>
<mapper resource="StudentMapper.xml"></mapper>
</mappers>
2.如果xxMapper类和xxMapper.xml在同一路径下,则使用class的方式进行注册,注册时只需注册mapper接口即可
<mappers>
<mapper class="com.zhang.mapper.StudentMapper"></mapper>
</mappers>