记录一个service找不到的bug,目前不知道为什么,bug如下
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): com.kwbbin.manage.service.DraftService.selectAllDraft] with root cause
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.kwbbin.manage.service.DraftService.selectAllDraft
首先service给了@service注解,在controller里面也给了@Autowired
重新编译,还是没有解决,有人说可能是controller调用的方法是私有的,我这也不是。
结果最后修改@mapperScan,把com.kwbbin.* 改为 com.kwbbin.dao,bug解决
这是我的目录结构,mapper文件是mybatis逆向工程自动生成的,放在dao包下