gpt4 book ai didi

java - 网页长时间打开抛出空指针异常

转载 作者:行者123 更新时间:2023-11-28 22:07:07 25 4
gpt4 key购买 nike

我正在使用 Apache - tomcat 5.5 作为服务器使用 JSP 和 Servlet 开发一个网站。我的应用程序运行良好。但是每当我打开任何网页并在一段时间后返回它时说 30 分钟,然后单击任何按钮或图标,它都会抛出错误说 -

Sep 16, 2011 2:11:33 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.homepage_jsp._jspService(homepage_jsp.java:107)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)

最佳答案

听起来您的 session 超时了。您需要强制用户重新登录,或延长 session 超时时间。

您可以通过编辑 web.xml 并添加以下内容来更改 session 超时:

<session-config>
<session-timeout>60</session-timeout>
</session-config>

这将为您提供 60 分钟的 session 超时。 -1 表示没有超时。

关于java - 网页长时间打开抛出空指针异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7450608/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com