问题描述
我用了struts+hibernate和tomcat运行的时候 开始还好.过段时间就会慢.然后就死掉了.页面打不开.报http500错误。重起下就好了部分错误日志如下:2010-5-130:20:58org.apache.catalina.core.StandardWrapperValveinvoke严重:Servlet.service()forservletactionthrewexceptionjava.lang.NullPointerExceptionatcom.talent.action.BbsAnswerFrontPageOperAction.execute(BbsAnswerFrontPageOperAction.java:45)2010-5-130:45:13org.apache.catalina.core.StandardWrapperValveinvoke严重:Servlet.service()forservletactionthrewexceptionjava.lang.NullPointerExceptionatcom.talent.action.PageOperFrontAction.execute(PageOperFrontAction.java:70)2010-5-130:53:15org.apache.catalina.core.StandardWrapperValveinvoke严重:Servlet.service()forservletactionthrewexceptionjava.lang.NullPointerExceptionatcom.talent.action.BbsAnswerFrontPageOperAction.execute(BbsAnswerFrontPageOperAction.java:45)2010-5-130:57:55org.apache.catalina.core.StandardWrapperValveinvoke严重:Servlet.service()forservletactionthrewexceptionjava.lang.NullPointerExceptionatcom.talent.action.BbsAnswerFrontPageOperAction.execute(BbsAnswerFrontPageOperAction.java:45)atcom.talent.common.SortSelect.Sort1id(SortSelect.java:22)atcom.talent.action.GGoodsFrontAction.execute(GGoodsFrontAction.java:76)atcom.talent.common.CharsetFiter.doFilter(CharsetFiter.java:24)atcom.talent.action.PageOperFrontAction.execute(PageOperFrontAction.java:91)atcom.talent.action.NewsPageOperAction.execute(NewsPageOperAction.java:51)atorg.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)atorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)atorg.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:690)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.talent.common.CharsetFiter.doFilter(CharsetFiter.java:24)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(UnknownSource)2010-5-134:25:54org.apache.catalina.core.ApplicationDispatcherinvoke严重:Servlet.service()forservletjspthrewexceptionjava.lang.NullPointerExceptionatorg.apache.jsp.FrontTcxb.yijilei_jsp._jspService(yijilei_jsp.java:777)atorg.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)atorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)atorg.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)atorg.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)atorg.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)atorg.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)atorg.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)atorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)atorg.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:690)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.talent.common.CharsetFiter.doFilter(CharsetFiter.java:24)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(UnknownSource)2010-5-134:25:54org.apache.catalina.core.StandardWrapperValveinvoke严重:Servlet.service()forservletactionthrewexceptionjava.lang.NullPointerExceptionatorg.apache.jsp.FrontTcxb.yijilei_jsp._jspService(yijilei_jsp.java:777)atorg.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)atorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)atorg.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)atorg.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)atorg.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)atorg.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)atorg.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)atorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)atorg.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:690)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.talent.common.CharsetFiter.doFilter(CharsetFiter.java:24)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(UnknownSource)2010-5-134:42:05org.apache.catalina.core.ApplicationDispatcherinvoke严重:Servlet.service()forservletjspthrewexception
解决方案
解决方案二:
atcom.talent.action.BbsAnswerFrontPageOperAction.execute(BbsAnswerFrontPageOperAction.java:45)atcom.talent.common.SortSelect.Sort1id(SortSelect.java:22)atcom.talent.action.GGoodsFrontAction.execute(GGoodsFrontAction.java:76)atcom.talent.common.CharsetFiter.doFilter(CharsetFiter.java:24)atcom.talent.action.PageOperFrontAction.execute(PageOperFrontAction.java:91)atcom.talent.action.NewsPageOperAction.execute(NewsPageOperAction.java:51)某些地方的连接没释放,导致取不到数据库连接了?这个Null怀疑是conn取不到,信息不够,不好判断。
解决方案三:
这问题我遇到过,我知道怎样解决.