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>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章