问题描述
- tomcat一直出这个问题HTTP Status 500
-
HTTP Status 500 - java.lang.NullPointerException
type Exception reportmessage java.lang.NullPointerException
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:548)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:469)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root causejava.lang.NullPointerException
org.apache.jsp.index_jsp._jspService(index_jsp.java:268)
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:431)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
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.20 logs.
解决方案
你的程序有问题,有对象为null,仔细检查下。
解决方案二:
服务器响应错误,从异常信息来看是常见的空指针异常。请检查访问的JSP页面某个对象的值为空了导致的。
解决方案三:
在服务端程序中加log等分析,服务代码出现错误了。
解决方案四:
检查下index.jsp文件,可能里面写的java代码有问题。