求大神帮忙:jsp报500错误

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

26: {
27: //w_conn = X60getConnection(hkalsip,hkalsdb,hkalslogin,hkalspwd);
28: w_conn = X60getConnection(dgalsip,dgalsdb,dgalslogin,dgalspwd);
29: w_stmt = w_conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
30:

31: w_rs = X61executeQuery(w_stmt, "SELECT fa_login FROM ta_user WHERE fa_login='" + p_login + "'");
32: if (!w_rs.next())

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:574)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
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:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.freestyle.common.servletsupport.RequestFilter.doFilter(RequestFilter.java:36)
root cause

java.lang.NullPointerException
org.apache.jsp.BMS902A2_jsp.createUserForALS(BMS902A2_jsp.java:3287)
org.apache.jsp.BMS902A2_jsp._jspService(BMS902A2_jsp.java:4016)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
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:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.freestyle.common.servletsupport.RequestFilter.doFilter(RequestFilter.java:36)

自己检查后,不清楚哪里错误,请大神帮忙!

5个回答

已经解决:(原来是sql中含有字段不存在表中),谢谢大家!

应该是w_conn为空,你打印下这个变量看看

 w_stmt = w_conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);

这行报错空指针,能出现控制正的变量可能有w_conn,ResultSet,这两个你需要好好排查下,直接是连接空了

500是服务器错误 你这边行数那些也给出来比较好排查,你这样问题很难看出来的格式也不好看

m0_38106248
黑夜的顾城 好的,下次注意格式问题,第一次提问题
接近 2 年之前 回复

Connection w_conn = null;

Statement w_stmt = null;

ResultSet w_rs = null;

try

{

w_conn = X60getConnection();

w_stmt = w_conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

w_rs = X61executeQuery(w_stmt,

"SELECT fa_name, fa_type, fa_remark,fa_line,fa_role,fa_status " +

",fa_plant "+

",fa_email "+

" FROM ta_user where fa_login='" + p_login + "' ");

w_rs.next();

w_name = w_rs.getString("fa_name");

w_type = w_rs.getString("fa_type");

w_remark = w_rs.getString("fa_remark");

w_role = w_rs.getString("fa_role");

w_man_lines = w_rs.getString("fa_line");

w_status = w_rs.getString("fa_status");

w_plant = w_rs.getString("fa_plant");

w_email = w_rs.getString("fa_email");

}

catch (Exception p_e)

{ throw p_e; }

finally

{ X63closeConn(w_conn, w_stmt, w_rs); }

具体代码

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐