mybatis--java.lang.IllegalArgumentException: Mapped Statements collection does n
今天整合spring和mybatis的时候有个错误一直出现,搞了半天才搞定。错误如下:
java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
at org.mybatis.spring.SqlSessionTemplate.wrapException(SqlSessionTemplate.java:371)
atorg.mybatis.spring.SqlSessionTemplate$7$1.doInSqlSession(SqlSessionTemplate.java:344)
atorg.mybatis.spring.SqlSessionTemplate.execute(SqlSessionTemplate.java:173)
atorg.mybatis.spring.SqlSessionTemplate.execute(SqlSessionTemplate.java:155)
atorg.mybatis.spring.SqlSessionTemplate$7.invoke(SqlSessionTemplate.java:339)
at $Proxy11.getAllUser(Unknown Source)最后终于找到问题,原来是命名空间没写对,如果使用mapper,则
<mapper namespace="com.sitech.mapper.StudentMapper">
namespace中一定要写上Mapper的名称,否则就会报错。
相关推荐
yupi0 2020-10-10
spring 2020-08-18
编程点滴 2020-07-29
幸运小侯子 2020-07-05
itjavashuai 2020-07-04
qingjiuquan 2020-06-29
shushan 2020-06-25
小鱿鱼 2020-06-22
咻pur慢 2020-06-18
melonjj 2020-06-17
qingjiuquan 2020-06-13
neweastsun 2020-06-05
小鱿鱼 2020-06-05
mxcsdn 2020-05-31
吾日五省我身 2020-05-27
牧场SZShepherd 2020-05-27
sweetgirl0 2020-05-14