标题:structs 登录connection报空指针
取消只看楼主
zyxnlbh
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2008-10-17
 问题点数:0 回复次数:1 
structs 登录connection报空指针
运行后报以下错误:

连接成功!
2008-10-17 11:58:06 org.apache.struts.action.RequestProcessor processException
警告: Unhandled Exception thrown: class java.lang.NullPointerException
2008-10-17 11:58:06 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet action threw exception
java.lang.NullPointerException
    at com.index.bean.WorkBean.isLogin(WorkBean.java:38)
    at com.index.struts.action.LoginAction.execute(LoginAction.java:48)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
    at org.apache.tomcat.(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Unknown Source)

Structs.rar (1.17 MB)
搜索更多相关主题的帖子: connection structs 指针 登录 
2008-10-17 12:18
zyxnlbh
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2008-10-17
得分:0 
谢谢你不过刚才我自己解决了
DriverManager.getConnection("jdbc:mysql://localhost:3306/users", "root", "123");
改为:
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/users", "root", "123");
2008-10-17 14:17



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-238809-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.553780 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved