org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.qiang.dao.UserMapper.xxxx 记录下这个折磨了我两天的问题
比较着急直接看黄字部分
我的问题是我的项目中有很多mapper文件,开始对新添加的cartitem(需要连接外表flower做展示)进行增删改都没有问题,昨天突然在刚启动index.jsp就出错跳转到了error.jsp页面。
index用的是对usermapper的操作,照理讲这个我最近一直都没动过应该没啥问题啊,所以我就又运行了下后台对admin操作的页面发现也不行,由此我就认为是配置路径的文件出问题了,几经试验发现我的路径是错的,又陷入了自闭
后来我又在test包下建了文件来测试usermapper持久层代码有无问题

 InputStream in= Resources.getResourceAsStream("sqlconfig.xml");SqlSessionFactory factory= new SqlSessionFactoryBuilder().build(in);SqlSession session= factory.openSession();UserMapper userMapper=session.getMapper(UserMapper.class);User users=userMapper.selectByPrimaryKey(2);
//        for (User user : users) {System.out.println(users);
//        }session.close();in.close();

发现还是报标题错,后来发现是我把cartitem的扫包注掉后就可以正常运行了

        <mapper resource="com/qiang/mapping/CartItemMapper.xml"/>

再一检查,原来是我的select语句有问题

<select id="findOne" parameterType="int" resultMap="BaseResultMap">select * from cartitem where <include refid="con"/></select>

我的select是涉及一对一的,所以要把cartitem对应的flower也要查出来也即<select id="findOne" parameterType="int" resultMap="BaseResultMap"> select cartitem.uid,cartitem.pid as fpid,cartitem.count,flower.* from cartitem natural join flower where <include refid="con"/> </select>
被自己蠢哭了orz

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.qiang.dao.UserM相关推荐

  1. 测试出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.suny.dao.Se

    本人小白刚学习java1个月,今天在做一个web的秒杀项目,在运行时出现如下错误 org.apache.ibatis.binding.BindingException: Invalid bound s ...

  2. 解决org.apache.ibatis.binding.BindingException Invalid bound statement (not found) com.fs.mapper.UserM

    首先我们来看看我的修改前的Mapper.xml文件 <mapper namespace="com.fs.mapper.UserMapper"><select id ...

  3. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.jt.mapper.UserM

    原因:没有扫描到UserMapper.findAll 方法1:配置文件放在跟resources目录下时:要在application.yml文件中SpringBoot整合Mybatis配置(classp ...

  4. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.my.mapper.UserM

    原因:xml文件只能在resources中过滤,UserMapper在resources外部. 方法一:拖进resourecs 方法二:在pom.xml中手动解析. <build>< ...

  5. 【踩坑】遇到 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 报错...

    今天在重做 iblog 客户端时,测试接口情况,发现了 org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...

  6. mybatis配置时出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)...

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

  7. mybatis-plus自定义mapper报org.apache.ibatis.binding.BindingException: Invalid bound statement(not found)

    今天在springboot的项目中,需要用到自定义的mapper,之前一直使用mybatis-plus自动生成的mapper,一直可以正常使用,今天因为需求需要,自定义了mapper,但是一直报这个错 ...

  8. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): dao.UserDao.selectU

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

  9. 解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误

    解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误 2018年07月23日 16:5 ...

最新文章

  1. 16_python_面向对象
  2. 用Latex写IEEE论文
  3. Use Visual Studio Code to create and run Transact-SQL scripts for SQL Server
  4. CSS可见区域全局居中
  5. echarts box
  6. mysql 变量赋值 in_MySQL 存储过程传参数实现where id in(1,2,3,...)实例效果
  7. 关于嵌入式学习随笔-2《GPIO基础知识》
  8. 台达b2伺服modbus通讯_台达伺服ASDA-B2使用手册-简体最新.pdf
  9. Unity之AB包的创建加载
  10. 一文学会Maven私服的搭建
  11. [WUSTCTF2020]alison_likes_jojo
  12. c语言字符串atoi函数,C++_C语言中一些将字符串转换为数字的函数小结,C语言atoi()函数:将字符串转换 - phpStudy...
  13. 华为mate7android版本,华为Mate7升级安卓6.0(EMUI4.0)M版本详细图文教程
  14. MFC对话框设置背景色及透明度
  15. 如何高效工作,手把手教你制定自己的时间表-20200408(第1期)
  16. H.266/VVC相关技术学习笔记4:HEVC和VVC中块划分的差别
  17. C语言数字图像处理进阶---3连环画风格滤镜
  18. JAVA简单快速排序讲解
  19. 精研物理 格物致知(二)
  20. i3-10110U和i5-1005G 1 哪个好

热门文章

  1. 选生物化学历史能不能报计算机专业,化学生物历史组合被禁:新高考为啥不能选化学生物历史?...
  2. 从 Airflow 到 Apache DolphinScheduler,有赞大数据开发平台的调度系统演进
  3. 30岁了 该如何谋划自己的未来
  4. java计算机毕业设计医院人事档案管理系源码+系统+mysql数据库+lw文档
  5. 免费实用的看图工具 Xee
  6. 职称计算机证书保质期多少年,请问PETS5证书取得后有效期是几年?谢谢!
  7. VescoFx - Provoker压缩VST插件
  8. 信号完整性入门笔记一-细解为什么低频信号在较短传输线不考虑反射?
  9. 一次令人吐血的ubuntu源码安装gcc-5.4.0经历
  10. 996普遍吗_网络常识不是太普遍