2014-02-20 28 views
2

IAM: -不能得到一個連接,池錯誤超時等待空閒對象:使用酒井2.9.1 後的服務器停止響應並打印記錄一些操作酒井

2014-02-20 12:48:47,085 WARN http-bio-8080-exec-18 org.sakaiproject.db.impl.BasicSqlService - Sql.dbRead: sql: select SAKAI_SITE.SITE_ID,SAKAI_SITE.TITLE,SAKAI_SITE.TYPE,SAKAI_SITE.SHO 
RT_DESC,SAKAI_SITE.DESCRIPTION,SAKAI_SITE.ICON_URL,SAKAI_SITE.INFO_URL,SAKAI_SITE.SKIN,SAKAI_SITE.PUBLISHED,SAKAI_SITE.JOINABLE,SAKAI_SITE.PUBVIEW,SAKAI_SITE.JOIN_ROLE,SAKAI_SITE.IS_SPE 
CIAL,SAKAI_SITE.IS_USER,SAKAI_SITE.CREATEDBY,SAKAI_SITE.MODIFIEDBY,SAKAI_SITE.CREATEDON,SAKAI_SITE.MODIFIEDON,SAKAI_SITE.CUSTOM_PAGE_ORDERED,SAKAI_SITE.IS_SOFTLY_DELETED,SAKAI_SITE.SOFT 
LY_DELETED_DATE from SAKAI_SITE where (SITE_ID = ?) !admin 
org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object 
     at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:104) 
     at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) 
     at org.sakaiproject.db.impl.BasicSqlService.borrowConnection(BasicSqlService.java:260) 
     at org.sakaiproject.db.impl.BasicSqlService.dbRead(BasicSqlService.java:540) 
     at org.sakaiproject.util.BaseDbFlatStorage.getResource(BaseDbFlatStorage.java:341) 
     at org.sakaiproject.util.BaseDbFlatStorage.getResource(BaseDbFlatStorage.java:321) 
     at org.sakaiproject.site.impl.DbSiteService$DbStorage.get(DbSiteService.java:236) 
     at org.sakaiproject.site.impl.BaseSiteService.getDefinedSite(BaseSiteService.java:616) 
     at org.sakaiproject.site.impl.BaseSiteService.getSite(BaseSiteService.java:702) 
     at org.sakaiproject.site.impl.BaseSiteService.getSiteVisit(BaseSiteService.java:780) 
     at org.sakaiproject.site.cover.SiteService.getSiteVisit(SiteService.java:140) 
     at org.sakaiproject.presence.tool.PresenceTool.doGet(PresenceTool.java:141) 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
     at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:634) 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
     at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) 
     at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471) 
     at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:369) 
     at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329) 
     at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:511) 
     at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1470) 
     at org.sakaiproject.portal.charon.handlers.PresenceHandler.doPresence(PresenceHandler.java:140) 
     at org.sakaiproject.portal.charon.handlers.PresenceHandler.doGet(PresenceHandler.java:70) 
     at org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:881) 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
     at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:695) 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) 
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) 
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) 
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) 
     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) 
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) 
     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) 
     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) 
     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
     at java.lang.Thread.run(Thread.java:619) 
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object 
     at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1167) 
     at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96) 
+1

看起來你沒有返回連接池(即connection.close()時使用的連接之後不叫)。這將解釋爲什麼池無法獲得「空閒」連接(由「超時等待空閒對象」表示)。 – vanOekel

+0

Sakai確實返回了游泳池的連接,並且已經這麼做了多年。這是一個多年來進行了相當一部分工作和測試的領域。 –

+0

您能提供服務器線程最大數量與您使用的數據庫最大連接數量嗎? – ledlogic

回答

2

你可能需要增加連接池的大小。您可能還需要調整數據庫的DBMS設置。以下是您將放入Sakai配置文件(通常爲sakai.properties)來控制數據庫池的設置。

# The initial number of connections that are created when the pool is started 
[email protected]=10 
# The maximum number of active connections that can be allocated from this pool at the same time, or zero for no limit. 
[email protected]=50 
# The maximum number of active connections that can remain idle in the pool, without extra ones being released, or zero for no limit. 
[email protected]=5 
# The minimum number of active connections that can remain idle in the pool, without extra ones being created, or 0 to create none. 
[email protected]=5 
相關問題