/**PageBeginHtml Block Begin **/ /***自定义返回顶部小火箭***/ /*生成博客目录的JS 开始*/ /*生成博客目录的JS 结束*/

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
    • 修改前的结构 
      修改前的结构

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

    •  

 

posted @ 2021-03-26 11:44  一品堂.技术学习笔记  阅读(137)  评论(0编辑  收藏  举报