IDEA中Spring Boot项目MyBaits提示Invalid bound statement (not found)错误

来源:互联网 发布:淘宝友邦电器城买假货 编辑:程序博客网 时间:2024/05/12 10:37

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

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

1 0
原创粉丝点击