MyBatis-Spring-Boot icon indicating copy to clipboard operation
MyBatis-Spring-Boot copied to clipboard

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

Open dangkefei opened this issue 8 years ago • 8 comments

我按你的方法及框架版本搭架环境,运行时总是显示错误: Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.dtjys.mapper.UserMapper.getById at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:196) at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:44) at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:59) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) at com.sun.proxy.$Proxy36.getById(Unknown Source) at org.dtjys.service.impl.UserService.show(UserService.java:17) at org.dtjys.Application.main(Application.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) 是什么原因? 使用mybatis-spring-boot-starter方式也出现了同样的问题

dangkefei avatar Aug 13 '16 13:08 dangkefei

如果使用通用Mapper提供的方法就可以正常执行,但是自己写的方法,就会提示上述错误

dangkefei avatar Aug 13 '16 14:08 dangkefei

这个问题目前依然存在

relsol avatar Sep 14 '16 09:09 relsol

注意看你 tk.xxx 的那个配置,不要用markerinterface方式。

abel533 avatar Sep 20 '16 14:09 abel533

可能是 idea的编译的问题 http://www.cnblogs.com/woshimrf/p/5138726.html

yangBin666 avatar Dec 29 '16 08:12 yangBin666

本项目已经修改,原理参考:Spring Boot - 配置排序依赖技巧

abel533 avatar Jan 02 '17 03:01 abel533

同,请问有人解决了吗?

YYZ-coder avatar May 07 '18 11:05 YYZ-coder

问题早解决了。。@CherryZY 用最新版本试试 2.0.3-beta1

abel533 avatar May 07 '18 13:05 abel533

我最近也遇到一样的问题 在IDEA下运行的时候能正常映射到对应XML文件里的SQL,但是打包部署到服务器上就不行了,就会报Invalid bound statement (not found):

GeneralAaron avatar Aug 12 '20 08:08 GeneralAaron