o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/demo] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zhiyou100.springboot_day06.mapper.DeptMapper.queryList] with root cause
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
上面的错误百度了很久,什么注释错误,映射错误,都检查了一遍,还是没解决。
最后发现,因为idea本身的错误,在建立文件夹的时候。
上图的mybatis.mapper,在逻辑上应该是两层的文件夹,如果创建的时候图省事,直接创建文件的时候就创建mybatis.mapper.*xml
,这样子的话,idea可能会创建一个名为mybatis.mapper的文件夹,
以至于找不到xml,需要手动的重命名,然后在mybatis里创建mapper,在mapper中创建xml文件。