异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
2017-12-15 19:10
861 查看
MyBatis 抛出异常如下:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.threegrand.urdm.system.dao.UserDao.saveUserat org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:184)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:38)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)
at com.sun.proxy.$Proxy19.saveUser(Unknown Source)
at com.threegrand.urdm.system.service.UserService.saveUser(UserService.java:20)
at com.threegrand.urdm.system.service.UserService$$FastClassBySpringCGLIB$$caacda27.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:266)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
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.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
at com.threegrand.urdm.system.service.UserService$$EnhancerBySpringCGLIB$$33d9263b.saveUser(<generated>)
at com.threegrand.urdm.userservice.UserServiceTest.testAdd(UserServiceTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
异常原因:
前提: 我把持久层 接口和xml映射文件同时放在一起.maven项目中, Java目录下默认只编译java文件,其它文件类型都被排除. 所以编译打包时,不会把java目录下的xml文件一起打包. 就会抛出此异常信息; 默认是这样,不过这个是可以通过配置修改的.
异常解决:
在maven项目中的.pom文件添加以下配置信息即可:<build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources> </build>
相关文章推荐
- 异常解决:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常解决
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)新的异常解决方案
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 解决过程
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常处理办法
- MyBatis笔记----报错:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法
- 解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- 关于org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),找不到mapper文件问题解决
- 解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)新的异常解决方案
- 解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- 出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)的解决方法
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常解决方案
- Intelij IDEA中web项目抛org.apache.ibatis.binding.BindingException: Invalid bound statement(not found):异常
- IDEA的maven项目出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误解决方法
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)新的异常解决方案
- 解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决
- eclipse里报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法