1,报错信息

log4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvironment).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/repository/org/slf4j/slf4j-log4j12/1.7.7/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/repository/ch/qos/logback/logback-classic/1.1.2/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.com.castbox.mapper.UserMapper.selectByPrimaryKey
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
at com.sun.proxy.$Proxy13.selectByPrimaryKey(Unknown Source)
at cn.com.castbox.service.impl.UserServiceImpl.selectByPrimaryKey(UserServiceImpl.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 java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
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:207)
at com.sun.proxy.$Proxy16.selectByPrimaryKey(Unknown Source)
at cn.com.castbox.service.UserServiceTest.main(UserServiceTest.java:33)

2,解决方案

检查UserMapper.xml文件所在namespace名称是否和Mapper interface所在的包名保持一致,如:

<mapper namespace="cn.com.castbox.dao.UserMapper">,看出,mapper的namespace有错误

Invalid bound statement (not found):xxx错误的可能原因的更多相关文章

  1. mybatis使用时org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):的错误

    最近在使用mybatis时,出现了 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 这 ...

  2. MyBatis错误--Invalid bound statement (not found)

    今天在开发项目的时候使用MyBatis发生错误:Invalid bound statement (not found) 具体错误信息: org.springframework.beans.factor ...

  3. mybatis3:Invalid bound statement (not found)

    最近在玩ssm框架搭建,突然发现最后的时候mybaits和SpringMvc进行整合的时候出现错误 Invalid bound statement (not found) 这个错误有可能出现在以下几个 ...

  4. invalid bound statement (not found)

    invalid bound statement (not found) mybatis 错误: 一般是Mapepr.xml文件中文nameapce没有和mapper接口发生映射,导致mybatis绑定 ...

  5. maven项目 报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

    ssm的项目如果在mapper.xml  mapper接口 配置没问题的情况下  项目依然报org.apache.ibatis.binding.BindingException: Invalid bo ...

  6. MyBatis绑定错误[Invalid bound statement (not found)]

    如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper i ...

  7. MyBatis 错误:Invalid bound statement (not found)

    错误: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zr.msgg.per ...

  8. mybatis错误之org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    玩了MyBatis差不多有两年了,中间也玩过MyBatis-Plus,这个MyBatis-Plus其实与MyBatis的区别并不大.今天写博客业务代码的时候,犯一个初学者犯过的错误. 错误信息如下:o ...

  9. [转载]Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample: 错误

    因碰到同样的问题,使用该方法对我有效,为方便以后查找,所以做了转载,原文请查看:https://www.cnblogs.com/fifiyong/p/5795365.html 在Maven工程下,想通 ...

随机推荐

  1. 单片机stm32小白入门级学习路线“图”

     学习stm32的是真的越来越多了,当然我也是其中语言,所以对于stm32的学习路线非常的感兴趣,所以我也分享一下  虽然是盗图吧  不过也算是分享 ,下边有觉得不错的视频资料  也奉上   (stm ...

  2. python中list添加元素的方法append()、extend()和insert()

    append()函数:将新元素追加到列表末尾 In [1]: a = [1, 2, 3, 4, 5] In [2]: a.append(6) In [3]: a Out[3]: [1, 2, 3, 4 ...

  3. [daily] 不让NetworkManger自动接管网络设备

    一  场景描述 有一个dpdk程序,在运行时使用了rte kni. 它启动的时候,会自动给系统增加一个网卡设备,停止运行的时候又会把它去掉.像这样: [root@T9 gen-py]# ip a : ...

  4. python NLTK安装

    stanford nltk在python中如何安装使用一直都很神秘,看了一些帖子感觉讳莫如深.研究了几天,参考<nlp汉语自然语言处理原理与实践>,发现方法如下: 1.安装JAVA 8+环 ...

  5. webpack4.27.1中遇到的错误

    1:ERROR in Entry module not found: Error: Can't resolve './src' 我在使用webpack命令时报错,这时因为我的配置文件有问题webpac ...

  6. 线程等待(java)

    定义一个对象: private Object objWaiter = new Object(); 在需要等待的地方加等待锁: synchronized (objWaiter) { objWaiter. ...

  7. vi光标移动

    1.上下左右移动 k  :上移一行 j  :下移一行 h :左移一行 l :右移一行 2.移到当前屏幕的首.中.尾部 H :移到当前屏幕的首部 M    :移到当前屏幕的中部 L :移到当前屏幕的尾部 ...

  8. 第四周Java作业

    老师说让用二维数组找最大,也就是最大和块,要求必须挨着,我其实不会写这个程序,所以我只能把自己的思路写出来 我觉得可以大问题缩小,我的思路是先把四个数一个正方形来进行计算,然后六个数矩形,把他化成两个 ...

  9. “QObject调用moveToThread()后 该如何释放”及QThread 的启动关闭

    1 QThread *thread = new QThread( ); 2 Task *task = new Task(); 3 task->moveToThread(thread); 4 co ...

  10. flask下载文件---文件流

    html: <a name="downloadbtn" class="btn btn-success pull-right" href="/do ...