zoukankan      html  css  js  c++  java
  • IDEA中Spring Boot项目MyBaits提示Invalid bound statement (not found)错误

    一个SpringBoot项目在STS中是正常的,没有任何问题,但是导入到IDEA中之后启动就提示org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误

    2017-05-01 20:29:30.089 ERROR 8580 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): hellowood.lntu.oe.wmp.dao.FeedbackDetailMapper.insertSelective] with root causeorg.apache.ibatis.binding.BindingException: Invalid bound statement (not found): ...........

    该错误提示没有找到相对应的XML文件,找了很长时间发现在编译后的classes路径下并没有相应的XML文件,这是因为IDEA在编译的时候忽略掉了XML文件,一个解决方法是将所有的XML文件移动到Resource文件夹下,这样在编译的时候就会将XML文件一起

    • 移动文件夹后修改配置文件中的MyBat的扫描路径
     mybatis.mapper-locations=classpath*:/mapper/**Mapper.xml
      • 修改前的结构 
        修改前的结构

      • 修改后的结构 
        修改后的结构

    为人:谦逊、激情、博学、审问、慎思、明辨、 笃行
    学问:纸上得来终觉浅,绝知此事要躬行
    为事:工欲善其事,必先利其器。
    态度:道阻且长,行则将至;行而不辍,未来可期
    转载请标注出处!
  • 相关阅读:
    并发编程概述
    学习笔记-ResNet网络
    学习笔记-反向传播算法
    学习笔记-canny边缘检测
    学习笔记-霍夫变换
    GitHub访问速度慢的一种优化方法
    C#开源定时回调库PETimer的使用
    C#开源网络通信库PESocket的使用
    XML在C#与Unity3D中的实战运用
    Unity本地持久化类Playerprefs使用详解
  • 原文地址:https://www.cnblogs.com/ios9/p/14581544.html
Copyright © 2011-2022 走看看