HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:583)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
root cause
org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0
org.springframework.dao.support.DataAccessUtils.requiredSingleResult(DataAccessUtils.java:71)
org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:475)
com.shidajiajiao.messageCallBack.MessageCallBackDAO.getMessageCallBackByMesgId(MessageCallBackDAO.java:59)
com.shidajiajiao.messageCallBack.MessageCallBackService.getMessageCallBackByMesgId(MessageCallBackService.java:64)
com.shidajiajiao.messageCallBack.MessageCallBackEditController.handleRequest(MessageCallBackEditController.java:27)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.26
能帮我把这个错误解释下吗
我不知道怎么修改错误了
------解决思路----------------------
你是不是用了spring jdbc 的queryForMap() 或者queryForObject().
这两个函数查询数据库的时候只能查询一条数据 而且 必须在数据库中有一条符合条件的数据。
如果没有符合查询条件的数据或者查询出多条数据都会报 Incorrect result size 错误.