2 heirenyagao2 heirenyagao2 于 2014.04.08 14:53 提问

jsp错误,求改,万分感谢

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

38: %>
39:
40: <%
41: List categories = CategoryService.getInstance().getCategories();
42: List topCategories = getTopCategories(categories);
43: %>
44:

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
com.bjsxt.shopping.util.filter.IPFilter.doFilter(IPFilter.java:31)

root cause

java.lang.NullPointerException
com.bjsxt.shopping.category.CategoryService.getCategories(CategoryService.java:102)
org.apache.jsp.Index_jsp._jspService(Index_jsp.java:97)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
com.bjsxt.shopping.util.filter.IPFilter.doFilter(IPFilter.java:31)

1个回答

shendixiong
shendixiong   2014.04.10 10:12

不说空指针异常吗?
你可以调试小这段代码 CategoryService.getInstance()

看是不是获取的这个实例为空啊

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!