HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception java.lang.NullPointerException
com.wy.tool.JDBConnection.executeQuery(JDBConnection.java:52)
com.wy.dao.ConsumerDao.getConsumerForm(ConsumerDao.java:98)
com.wy.webiter.ConsumerServlet.checkConsumer(ConsumerServlet.java:169)
com.wy.webiter.ConsumerServlet.doGet(ConsumerServlet.java:16)
com.wy.webiter.ConsumerServlet.doPost(ConsumerServlet.java:186)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.
--------------------------------------------------------------------------------Apache Tomcat/6.0.16
com.wy.tool.JDBConnection.executeQuery(JDBConnection.java:52)
com.wy.dao.ConsumerDao.getConsumerForm(ConsumerDao.java:98)
com.wy.webiter.ConsumerServlet.checkConsumer(ConsumerServlet.java:169)
com.wy.webiter.ConsumerServlet.doGet(ConsumerServlet.java:16)
com.wy.webiter.ConsumerServlet.doPost(ConsumerServlet.java:186)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.
--------------------------------------------------------------------------------Apache Tomcat/6.0.16
空指针异常public class NullPointerException
extends RuntimeException
当应用程序试图在需要对象的地方使用 null 时,抛出该异常。这种情况包括: 调用 null 对象的实例方法。
访问或修改 null 对象的字段。
将 null 作为一个数组,获得其长度。
将 null 作为一个数组,访问或修改其时间片。
将 null 作为 Throwable 值抛出。
应用程序应该抛出该类的实例,指示其他对 null 对象的非法使用。
com.wy.tool.JDBConnection.executeQuery(JDBConnection.java:52) 楼主自己看看信息,空指针异常,是你在执行查询的时候发生的,自己DEBUG跟踪一下,看看JDBConnection的52行!
执行数据库查询时出现的错误
看看你的数据库中的数据是否为空,或者你的查询语句是否出现异常
引发的空异常 java.lang.NullPointerException加个断点在 52行 看看。是什么为null了?
log跟踪,像这样的问题就是没有理解对象出生没出生的概念
你看看这里有没有做null处理!!
要加上object!=null