m0_38106248
黑夜的顾城
2018-08-04 07:29
采纳率: 50%
浏览 1.8k
已采纳

求大神帮忙: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条回答 默认 最新

  • m0_38106248
    黑夜的顾城 2018-08-29 03:31
    已采纳

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

    点赞 评论
  • m0_38106248
    黑夜的顾城 2018-08-04 07:34

    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); }

    具体代码

    点赞 评论
  • it_zhangwei
    路漫漫兮其修远兮 2018-08-04 07:39
     w_stmt = w_conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
    

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

    点赞 评论
  • weixin_42665191
    筱~破^ 2018-08-06 01:33

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

    点赞 评论
  • zhaomin_g
    _zming 2018-08-06 04:37

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

    点赞 评论

相关推荐