DEBUG - DispatcherServlet with name 'springmvc' processing GET request for [/spring0100_war/user/list] DEBUG - Looking up handler method for path /user/list DEBUG - Returning handler method [public java.lang.String com.edu.controller.UserController.queryAllUsers(org.springframework.ui.Model)] DEBUG - Returning cached instance of singleton bean 'UserController' DEBUG - Last-Modified value for [/spring0100_war/user/list] is: -1 DEBUG - Resolving exception from handler [public java.lang.String com.edu.controller.UserController.queryAllUsers(org.springframework.ui.Model)]: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.edu.service.UserService.queryAllUsers DEBUG - Resolving exception from handler [public java.lang.String com.edu.controller.UserController.queryAllUsers(org.springframework.ui.Model)]: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.edu.service.UserService.queryAllUsers DEBUG - Resolving exception from handler [public java.lang.String com.edu.controller.UserController.queryAllUsers(org.springframework.ui.Model)]: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.edu.service.UserService.queryAllUsers DEBUG - Could not complete request
时间: 2024-04-27 12:19:20 浏览: 67
Debug 命令
从日志中可以看到,出现了 `org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)` 异常,这是因为 MyBatis 找不到名为 `com.edu.service.UserService.queryAllUsers` 的 SQL 语句引起的。
你可以再次检查一下 `com.edu.service.UserService.queryAllUsers` 的 Mapper XML 文件和 Mapper 接口文件是否都存在,是否都使用了相同的命名空间和 id,以及 SQL 语句的语法是否正确。
如果以上检查都没有问题,你可以在启动应用时开启 MyBatis 的 DEBUG 级别日志输出(参考上面的回答),进一步查看具体的错误信息,看看是否能够定位问题所在。
阅读全文