您的位置:首页 > 编程语言 > Java开发

springboot 集成mybatis Invalid bound statement (not found)异常

2016-10-11 15:44 811 查看

场景

在使用springboot集成mybatis的过程中出现一下异常。经过跟踪发现其实异常与springboot无关,主要是mybatis配置文件的原因。大家遇到类似问题,可直接进行定位。

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.antifraud.mapper.TestMapper.getTestList
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:214) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:48) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:59) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) ~[mybatis-3.4.0.jar:3.4.0]
at com.sun.proxy.$Proxy68.getTestList(Unknown Source) ~[na:na]


问题定位及解决

首先定位问题在Mapper配置文件。

主要检查配置文件中此段代码:

<mapper namespace="com.antifraud.domain.Test" >


以上代码是我错误的示范。正式因为本应该配置为对应mapper类的namespace配置成domain类了。

因此,将上面的类指定为对应的mapper类即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: