错误产生环境
单独测试 mybatis 环境
错误描述
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in cn/bloghut/dao/StudentMapper.xml
### The error occurred while processing mapper_resultMap[StudentTeacher]
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'cn/bloghut/dao/StudentMapper.xml'. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for cn.bloghut.dao.StudentMapper.getStudents. please check cn/bloghut/dao/StudentMapper.xml and cn/bloghut/dao/StudentMapper.xml
错误原因
mapper.xml文件 的标签标签 的id属性重名了
解决办法
修改id属性的名字即可