报错500

报错500

HTTP Status 500 – Internal Server Error

Type 异常报告

消息 Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.imooc.oa.dao.DepartmentDao.selectAll

描述 服务器遇到一个意外的情况,阻止它完成请求。

Exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.imooc.oa.dao.DepartmentDao.selectAll
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:973)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Root Cause

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.imooc.oa.dao.DepartmentDao.selectAll
org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:225)
org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:48)
org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65)
org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
com.sun.proxy.$Proxy20.selectAll(Unknown Source)
com.imooc.oa.biz.impl.DepartmentDaoImpl.getAll(DepartmentDaoImpl.java:34)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
com.sun.proxy.$Proxy22.getAll(Unknown Source)
com.imooc.oa.controller.DepartmentController.list(DepartmentController.java:19)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

):注意 主要问题的全部 stack 信息可以在 server logs 里查看

Apache Tomcat/8.5.50


正在回答

登陆购买课程后可参与讨论,去登陆

1回答

同学你好,报错提示是绑定错误,如:

http://img1.sycdn.imooc.com//climg/5e79ee8f0937dc4c08080140.jpg

建议同学查看一下dao接口和dao.xml文件的目录是否一致,如:

http://img1.sycdn.imooc.com//climg/5e79eeb8094de6a404430373.jpg

如果不一致,需要修改为一致。如果一致,同学创建resource下的目录时,是否一层一层的创建,或使用/创建目录。如果不是,建议同学一层一层创建再试试。

如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~

  • 慕尼黑5444710 提问者 #1
    我创建的文件com.imooc.oa.dao里面没有圈圈,目录是对的还是报错,在网上看了好多说是概率性错误。。。
    2020-03-24 19:47:29
  • 慕尼黑5444710 提问者 #2
    服务器可以正常运行,但是一遇到调用什么方法的时候就不行。。。
    2020-03-24 20:02:51
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师