Web应用程序[ROOT]仍在处理尚未完成的请求。[Tomcat的]

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (298)

我今天在尝试关闭服务器时看到了这个错误。

这是完整的堆栈跟踪。

06-Jul-2015 05:47:10.407 WARNING [RMI TCP Connection(5)-127.0.0.1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Stack trace of request processing thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 org.apache.tomcat.dbcp.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:582)
 org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:439)
 org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:360)
 org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:118)
 org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)
 com.raghavpro.bookhive.models.database.DatabaseConnectivity.getConnection(DatabaseConnectivity.java:26)
 com.raghavpro.bookhive.controllers.book.DetailsServlet.doGet(DetailsServlet.java:35)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
 org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 java.lang.Thread.run(Thread.java:745)

看起来它与数据库池有关。我能做错什么?

如果重要的话,这是我的context.xml。

<Resource name="jdbc/bookhive_db" auth="Container" type="javax.sql.DataSource"
          maxActive="10" maxIdle="4" maxWait="10000"
          username="admin_bookhive" password="1208019" driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/bookhive_db"/>
提问于
用户回答回答于

好的,我忘了关闭连接对象。我没有在finally块中关闭它而忘记调用该方法。

用户回答回答于

关闭连接对象的配置在哪里?管理怎么样?

扫码关注云+社区

领取腾讯云代金券