博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
阅读量:5363 次
发布时间:2019-06-15

本文共 4315 字,大约阅读时间需要 14 分钟。

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.study.mybatis.spring.user.mapper.UserMapper.countAll	at org.apache.ibatis.binding.MapperMethod$SqlCommand.
(MapperMethod.java:225) at org.apache.ibatis.binding.MapperMethod.
(MapperMethod.java:48) at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58) at com.sun.proxy.$Proxy15.countAll(Unknown Source) at com.study.mybatis.spring.user.daoImpl.UserDaoImpl.countAll(UserDaoImpl.java:19) at com.study.mybatis.spring.user.serviceImpl.UserServiceImpl.countAll(UserServiceImpl.java:18) 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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.$Proxy18.countAll(Unknown Source) at com.study.mybatis.spring.user.test.UserServiceTest.userServiceTest(UserServiceTest.java:28) 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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

  

三种情况:

1.  mapper的namespace写的不对!!!注意系修改。(本人是由于该问题导致,包名出现问题)

2.UserDao的方法在UserDao.xml中没有,然后执行UserDao的方法会报此

3. UserDao的方法返回值是List,而select元素没有正确配置ResultMap,或者只配置ResultType!

4. 如果你确认没有以上问题,请任意修改下对应的xml文件,比如删除一个空行,保存.问题解决...

 

参考链接:

转载于:https://www.cnblogs.com/woniu4/p/9281696.html

你可能感兴趣的文章
springmvc重定向
查看>>
Webmin试玩
查看>>
拥抱互联网经济新增长点,微软云为视频直播提速
查看>>
知识的总结
查看>>
Web框架——XWAF的代码结构和运行机制(4)
查看>>
实验四
查看>>
python积累二:中文乱码解决方法
查看>>
poj 1179 polygon
查看>>
用Apache Ant在Weka中嵌入新算法
查看>>
hdu--4632--dp
查看>>
htc在ubuntu上找不到devieces,提示权限不够的解决方法
查看>>
Angular系列-AngularJs1使用Ace编辑器
查看>>
JDK5新特性
查看>>
Java之冒泡算法实现
查看>>
平时关注的一些技术博客
查看>>
任务调度
查看>>
安装Android开发环境
查看>>
Delphi 判断按键状态
查看>>
数学:调和级数
查看>>
图论:带花树算法-一般图最大权匹配
查看>>