这是什么问题呀prevented it from fulfilling this request.

type Exception report

message An exception occurred processing JSP page /25.jsp at line 22

description The server encountered an internal error that prevented it from fulfilling this request.

exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /25.jsp at line 22

19:
20: List ls= null;
21: try {
22: ls = iu.findUsersAll();
23: } catch (SQLException e) {
24: e.printStackTrace();
25: }

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:405)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:349)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause
java.lang.NullPointerException
controller.UsersImpl.findUsersAll(UsersImpl.java:27)
org.apache.jsp._25_jsp._jspService(_25_jsp.java:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:405)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:349)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note The full stack trace of the root cause is available in the Apache Tomcat/8.0.9 logs.

4个回答

看UsersImpl的27行

java.lang.NullPointerException
controller.UsersImpl.findUsersAll(UsersImpl.java:27) 

另外空指针异常的原理是:

x = a.b.c

则 a 或 b 为 null 会导致空指针异常,而 c 为 null 不会

java.lang.NullPointerException. 空指针

qq_27104997
爱吃蛋炒饭加蛋 咋解决呀。大神
2 年多之前 回复

java.lang.NullPointerException. 这是空指针异常!!

qq_27104997
爱吃蛋炒饭加蛋 咋解决呀。大神
2 年多之前 回复

空指针异常,根据错误代码,回报这个错误的地方就是iu.findUsersAll();看看iu是不是null

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐