注册 登录
编程论坛 J2EE论坛

[求助]我的JSP运行老是报错!

yangyucn 发布于 2006-05-22 11:46, 749 次点击
org.apache.jasper.JasperException
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NullPointerException
	electric.dbs.Newsdb.selectsql(Newsdb.java:34)
	org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:63)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
大家帮我看看 是怎么回事??
3 回复
#2
可可℃乐2006-05-22 16:40
空指针问题.可能是你的某些引用没有赋值.声明的时候最好赋值NULL.
试试看看能不能好起来.
#3
yangwudong2006-05-22 23:23
哈哈,楼上的同学又错了,初始化的时候赋null那是更加容易抛空指针异常了啊!尽量注意啊!
#4
zhangheng2006-05-23 12:18

不过我上回也是空指针,用的是重新赋值空就好咯.

1