问题描述
HTTPStatus500---------------------------------------------------------------------------------typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatpreventeditfromfulfillingthisrequest.exceptionorg.apache.jasper.JasperException:AnexceptionoccurredprocessingJSPpage/user/registerAdd.jspatline5047:48:}else{49:VipInfoDAOvipInfoDAO=newVipInfoDAO();50:out.println(vipInfoDAO.findByType(1).getV_id());51:Stringinsert="insertintouserinfo(u_username,u_password,v_id,j_id,u_qq,u_email,u_sex,u_phone)values('"+name+"','"+pwd+"','"+vipInfoDAO.findByType(1).getV_id()+"','1','"+qq+"','"+Email+"','"+sex+"','"+phone+"')";52:intrs2=mdb.executeUpdate(insert);53:if(rs2!=0){Stacktrace:org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rootcausejava.lang.NullPointerExceptioncom.xmlg.rjgc.connDB.CommonDB.executeQuery(CommonDB.java:39)com.xmlg.rjgc.connDB.services.impl.VipInfoDAO.findByType(VipInfoDAO.java:67)org.apache.jsp.user.registerAdd_jsp._jspService(registerAdd_jsp.java:117)org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)noteThefullstacktraceoftherootcauseisavailableintheApacheTomcat/6.0.13logs.--------------------------------------------------------------------------------ApacheTomcat/6.0.13要怎样修改
解决方案
本帖最后由 qq_23487713 于 2015-01-17 23:44:31 编辑
解决方案二:
clean项目,把%tomcat_home%workCatalinalocalhost对应的项目删除,重新运行试试。是所有jsp都报这错还是只有这个?
解决方案三:
可能是由于vipInfoDAO.findByType(1)得到的是null
解决方案四:
com.xmlg.rjgc.connDB.CommonDB.executeQuery(CommonDB.java:39)这个类39行空指针异常,看看代码是不是数据库连接获取不到导致的