关于mybatis的路径下未配置导致网址出现错误代码:500的问题
按照视频的教程跟进到员工管理-基本实现的时候配置完source文件下的EmpMapper.yml文件的时候mybatis配置好了路径,但是实际配置好SQL语句执行的时候还是报错错误代码500,在报错的代码的日志找到了2026-03-07 23:06:25.263 [http-nio-8080-exec-1] ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet]-Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.hhh.tilaswebmanagement.mapper.EmpMapper.list] with root cause
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.hhh.tilaswebmanagement.mapper.EmpMapper.list
at org.apache.ibatis.binding.MapperMethod$SqlCommand.
at org.apache.ibatis.binding.MapperMethod.
at org.apache.ibatis.binding.MapperProxy.lambda$cachedInvoker$0(MapperProxy.java:96)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.apache.ibatis.util.MapUtil.computeIfAbsent(MapUtil.java:36)
at org.apache.ibatis.binding.MapperProxy.cachedInvoker(MapperProxy.java:94)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)
at jdk.proxy2/jdk.proxy2.$Proxy72.list(Unknown Source)
的信息,觉得时不时sql语句的问题,重新取消了EmpMapper.java下的@Select("select e.,d.name deptName from emp e left join dept d on e.dept_id = d.id order" +
"" + " by e.update_time desc")注释发现apifox的消息可以正常接受,看了很久最后在application.yml文件重新在mybatis文件下添加了一条的路径信息:mapper-locations: classpath:com/hhh/mapper/.xml,重新启动发现可以正常的接受到数据

浙公网安备 33010602011771号