Mybatis异常:Mapped Statements collection already contains value for xxx

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [/x x xx/classes/mapper/StudentDao.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for org.ty.cloudCourse.dao.StudentDao.queryStudent        

解决方法:苦寻一天未找到原因,于是一条方法一条方法删,发现这个dao.xml中写了两个id为queryStudent的<select>

猜你喜欢

转载自blog.csdn.net/qq_37580283/article/details/80453124