org.hibernate.exception.GenericJDBCException: Cannot open connection

Hibernate JIRA | shirishmaurya | 5 years ago
  1. 0

    [JBAS-9494] unable to get managed connection with java hibernate jboss 5.1 - JBoss Issue Tracker

    jboss.org | 1 year ago
    org.hibernate.exception.GenericJDBCException: Cannot open connection
  2. 0

    Hi , i have a issue reported with jboss 5.1, linux and java based hibernate ,oracle 11.2.3.0 DB,Hibernate 3.3.2.GA while load testing for application for jboss on one JVM load balanced on each server ( i.e 2 JVM) heap 1.5 GB while running test for 200 users i was able to perform the test successfully . session are getting closed up and it happens afters say exactly 22 min for test for 400 users , for 200 users it works fine. his is my hibernate properties files it uses jndi name to connect i.e via ds.xml file of jboss 03:29:45,068 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled 03:29:45,068 INFO [SettingsFactory] Automatic session close at end of transaction: disabled 03:29:45,070 INFO [SettingsFactory] Scrollable result sets: enabled 03:29:45,070 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled 03:29:45,071 INFO [SettingsFactory] Connection release mode: auto 03:29:45,072 INFO [SettingsFactory] Default batch fetch size: 4 03:29:45,072 INFO [SettingsFactory] Generate SQL with comments: disabled 03:29:45,072 INFO [SettingsFactory] Order SQL updates by primary key: disabled 03:29:45,073 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 03:29:45,078 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory 03:29:45,079 INFO [SettingsFactory] Query language substitutions: {} 03:29:45,079 INFO [SettingsFactory] JPA-QL strict compliance: disabled 03:29:45,079 INFO [SettingsFactory] Second-level cache: disabled 03:29:45,079 INFO [SettingsFactory] Query cache: disabled 03:29:45,079 INFO [SettingsFactory] Optimize cache for minimal puts: disabled 03:29:45,079 INFO [SettingsFactory] Structured second-level cache entries: disabled 03:29:45,092 INFO [SettingsFactory] Statistics: disabled also changed the Connection release mode to on close and track transation but no where it helps as i increase the amount of users to 400 after exact 20 mins of test i start getting errors as unable to get managed connection following is the ds.xml file into min-pool-size>1</min-pool-size> <max-pool-size>64</max-pool-size> <query-timeout>300</query-timeout> <idle-timeout-minutes>0</idle-timeout-minutes> <blocking-timeout-millis>50000</blocking-timeout-millis> <use-strict-min>true</use-strict-min> <track-statements>true</track-statements> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name> <metadata> <type-mapping>Oracle11g</type-mapping> </metadata> </local-tx-datasource> </datasources> 2012-05-19 02:54:01,406 INFO [org.hibernate.cfg.SettingsFactory] (main) Automatic flush during beforeCompletion(): disabled 2012-05-19 02:54:01,406 INFO [org.hibernate.cfg.SettingsFactory] (main) Automatic session close at end of transaction: disabled 2012-05-19 02:54:01,407 INFO [org.hibernate.cfg.SettingsFactory] (main) Scrollable result sets: enabled 2012-05-19 02:54:01,407 INFO [org.hibernate.cfg.SettingsFactory] (main) JDBC3 getGeneratedKeys(): disabled 2012-05-19 02:54:01,407 INFO [org.hibernate.cfg.SettingsFactory] (main) Connection release mode: auto 2012-05-19 02:54:01,408 INFO [org.hibernate.cfg.SettingsFactory] (main) Default batch fetch size: 4 2012-05-19 02:54:01,409 INFO [org.hibernate.cfg.SettingsFactory] (main) Generate SQL with comments: disabled 2012-05-19 02:54:01,409 INFO [org.hibernate.cfg.SettingsFactory] (main) Order SQL updates by primary key: disabled 2012-05-19 02:54:01,409 INFO [org.hibernate.cfg.SettingsFactory] (main) Order SQL inserts for batching: disabled 2012-05-19 02:54:01,409 INFO [org.hibernate.cfg.SettingsFactory] (main) Query translator: org.hibernate.hql.ast.ASTQueryTranslatorF actory 2012-05-19 02:54:01,413 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] (main) Using ASTQueryTranslatorFactory 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Query language substitutions: {} 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) JPA-QL strict compliance: disabled 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Second-level cache: disabled 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Query cache: disabled 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Cache region factory : org.hibernate.cache.impl.NoCachingRe gionFactory 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Optimize cache for minimal puts: disabled 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Structured second-level cache entries: disabled 2012-05-19 02:54:01,422 INFO [org.hibernate.cfg.SettingsFactory] (main) Statistics: disabled 2012-05-19 02:54:01,423 INFO [org.hibernate.cfg.SettingsFactory] (main) Deleted entity synthetic identifier rollback: disabled 2012-05-19 02:54:01,423 INFO [org.hibernate.cfg.SettingsFactory] (main) Default entity-mode: pojo 2012-05-19 02:54:01,423 INFO [org.hibernate.cfg.SettingsFactory] (main) Named query checking : enabled error msg org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.loadCollectionBatch(Loader.java:2057) at org.hibernate.loader.collection.BatchingCollectionInitializer.initialize(BatchingCollectionInitializer.java:70) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventL istener.java:83) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1744) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108) at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.populateBonusRecordDetails(VerificationRecordCalcSh eet.java:153) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.getEmployeeRecordsFromForecast(VerificationRecordCa lcSheet.java:60) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.getCurrentVerificationRecord(VerificationRecordCalc Sheet.java:34) at com.pepsico.mya.bonus.struts.verification.ViewVerificationSheetAction.execute(ViewVerificationSheetAction.java:168) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.RoleModeFilter.doFilter(RoleModeFilter.java:44) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.security.SecurityContextFilter.doFilter(SecurityContextFilter.java:138) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.LocaleFilter.doFilter(LocaleFilter.java:59) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:86) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.SessionSettingsFilter.doFilter(SessionSettingsFilter.java:187) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:8 1) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436) at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451) at java.lang.Thread.run(Thread.java:662) Caused by: org.jboss.util.NestedSQLException: Unable to get managed connection for jdbc/mya/bonusPool; - nested throwable: (javax.re source.ResourceException: Unable to get managed connection for jdbc/mya/bonusPool) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java :82) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) ... 84 more Caused by: javax.resource.ResourceException: Unable to get managed connection for jdbc/mya/bonusPool at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:441) at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:424) at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496) at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManag er2.java:941) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89) ... 86 more Caused by: javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 50000 [ms] ) at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:311) at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:69 0) at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404) ... 90 more 2012-05-19 03:36:46,258 ERROR [com.pepsico.mya.bonus.exception.ApplicationException] (ajp-lrhisa02.hewitt.com%2F10.20.95.36-12002-17 6) Entity is still being used in the application. 2012-05-19 03:36:46,262 ERROR [com.pepsico.mya.bonus.exception.BusinessException] (ajp-lrhisa02.hewitt.com%2F10.20.95.36-12002-176) Entity is still being used in the application. 2012-05-19 03:36:40,158 ERROR [com.pepsico.mya.bonus.struts.calcsheet.CalculationSheetLoadAction] (ajp-lrhisa02.hewitt.com%2F10.20.9 5.36-12002-156) Unable to create verification record sheet org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.loadCollectionBatch(Loader.java:2057) at org.hibernate.loader.collection.BatchingCollectionInitializer.initialize(BatchingCollectionInitializer.java:70) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventL istener.java:83) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1744) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108) at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.populateBonusRecordDetails(VerificationRecordCalcSh eet.java:153) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.getEmployeeRecordsFromForecast(VerificationRecordCa lcSheet.java:60) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.getCurrentVerificationRecord(VerificationRecordCalc Sheet.java:34) at com.pepsico.mya.bonus.struts.verification.ViewVerificationSheetAction.execute(ViewVerificationSheetAction.java:168) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1078) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:295) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:396) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:347) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.RoleModeFilter.doFilter(RoleModeFilter.java:44) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.security.SecurityContextFilter.doFilter(SecurityContextFilter.java:138) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.LocaleFilter.doFilter(LocaleFilter.java:59) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:86) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.SessionSettingsFilter.doFilter(SessionSettingsFilter.java:187) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) Caused by: org.jboss.util.NestedSQLException: Unable to get managed connection for jdbc/mya/bonusPool; - nested throwable: (javax.re source.ResourceException: Unable to get managed connection for jdbc/mya/bonusPool) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java :82) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) ... 99 more Caused by: javax.resource.ResourceException: Unable to get managed connection for jdbc/mya/bonusPool at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:441) at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:424) at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496) at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManag er2.java:941) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89) ... 101 more Caused by: javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 50000 [ms] ) at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:311) at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:69 0) at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404) ... 105 more 2012-05-19 03:36:40,198 ERROR [com.pepsico.mya.bonus.struts.calcsheet.CalculationSheetLoadAction] (ajp-lrhisa02.hewitt.com%2F10.20.9 5.36-12002-140) Unable to create verification record sheet org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.loadCollectionBatch(Loader.java:2057) at org.hibernate.loader.collection.BatchingCollectionInitializer.initialize(BatchingCollectionInitializer.java:70) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventL istener.java:83) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1744) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108) at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272) Please provide some resolution for troubleshooting.

    Hibernate JIRA | 5 years ago | shirishmaurya
    org.hibernate.exception.GenericJDBCException: Cannot open connection
  3. 0

    Hi , i have a issue reported with jboss 5.1, linux and java based hibernate ,oracle 11.2.3.0 DB,Hibernate 3.3.2.GA while load testing for application for jboss on one JVM load balanced on each server ( i.e 2 JVM) heap 1.5 GB while running test for 200 users i was able to perform the test successfully . session are getting closed up and it happens afters say exactly 22 min for test for 400 users , for 200 users it works fine. his is my hibernate properties files it uses jndi name to connect i.e via ds.xml file of jboss 03:29:45,068 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled 03:29:45,068 INFO [SettingsFactory] Automatic session close at end of transaction: disabled 03:29:45,070 INFO [SettingsFactory] Scrollable result sets: enabled 03:29:45,070 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled 03:29:45,071 INFO [SettingsFactory] Connection release mode: auto 03:29:45,072 INFO [SettingsFactory] Default batch fetch size: 4 03:29:45,072 INFO [SettingsFactory] Generate SQL with comments: disabled 03:29:45,072 INFO [SettingsFactory] Order SQL updates by primary key: disabled 03:29:45,073 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 03:29:45,078 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory 03:29:45,079 INFO [SettingsFactory] Query language substitutions: {} 03:29:45,079 INFO [SettingsFactory] JPA-QL strict compliance: disabled 03:29:45,079 INFO [SettingsFactory] Second-level cache: disabled 03:29:45,079 INFO [SettingsFactory] Query cache: disabled 03:29:45,079 INFO [SettingsFactory] Optimize cache for minimal puts: disabled 03:29:45,079 INFO [SettingsFactory] Structured second-level cache entries: disabled 03:29:45,092 INFO [SettingsFactory] Statistics: disabled also changed the Connection release mode to on close and track transation but no where it helps as i increase the amount of users to 400 after exact 20 mins of test i start getting errors as unable to get managed connection following is the ds.xml file into min-pool-size>1</min-pool-size> <max-pool-size>64</max-pool-size> <query-timeout>300</query-timeout> <idle-timeout-minutes>0</idle-timeout-minutes> <blocking-timeout-millis>50000</blocking-timeout-millis> <use-strict-min>true</use-strict-min> <track-statements>true</track-statements> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name> <metadata> <type-mapping>Oracle11g</type-mapping> </metadata> </local-tx-datasource> </datasources> 2012-05-19 02:54:01,406 INFO [org.hibernate.cfg.SettingsFactory] (main) Automatic flush during beforeCompletion(): disabled 2012-05-19 02:54:01,406 INFO [org.hibernate.cfg.SettingsFactory] (main) Automatic session close at end of transaction: disabled 2012-05-19 02:54:01,407 INFO [org.hibernate.cfg.SettingsFactory] (main) Scrollable result sets: enabled 2012-05-19 02:54:01,407 INFO [org.hibernate.cfg.SettingsFactory] (main) JDBC3 getGeneratedKeys(): disabled 2012-05-19 02:54:01,407 INFO [org.hibernate.cfg.SettingsFactory] (main) Connection release mode: auto 2012-05-19 02:54:01,408 INFO [org.hibernate.cfg.SettingsFactory] (main) Default batch fetch size: 4 2012-05-19 02:54:01,409 INFO [org.hibernate.cfg.SettingsFactory] (main) Generate SQL with comments: disabled 2012-05-19 02:54:01,409 INFO [org.hibernate.cfg.SettingsFactory] (main) Order SQL updates by primary key: disabled 2012-05-19 02:54:01,409 INFO [org.hibernate.cfg.SettingsFactory] (main) Order SQL inserts for batching: disabled 2012-05-19 02:54:01,409 INFO [org.hibernate.cfg.SettingsFactory] (main) Query translator: org.hibernate.hql.ast.ASTQueryTranslatorF actory 2012-05-19 02:54:01,413 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] (main) Using ASTQueryTranslatorFactory 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Query language substitutions: {} 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) JPA-QL strict compliance: disabled 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Second-level cache: disabled 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Query cache: disabled 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Cache region factory : org.hibernate.cache.impl.NoCachingRe gionFactory 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Optimize cache for minimal puts: disabled 2012-05-19 02:54:01,413 INFO [org.hibernate.cfg.SettingsFactory] (main) Structured second-level cache entries: disabled 2012-05-19 02:54:01,422 INFO [org.hibernate.cfg.SettingsFactory] (main) Statistics: disabled 2012-05-19 02:54:01,423 INFO [org.hibernate.cfg.SettingsFactory] (main) Deleted entity synthetic identifier rollback: disabled 2012-05-19 02:54:01,423 INFO [org.hibernate.cfg.SettingsFactory] (main) Default entity-mode: pojo 2012-05-19 02:54:01,423 INFO [org.hibernate.cfg.SettingsFactory] (main) Named query checking : enabled error msg org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.loadCollectionBatch(Loader.java:2057) at org.hibernate.loader.collection.BatchingCollectionInitializer.initialize(BatchingCollectionInitializer.java:70) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventL istener.java:83) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1744) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108) at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.populateBonusRecordDetails(VerificationRecordCalcSh eet.java:153) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.getEmployeeRecordsFromForecast(VerificationRecordCa lcSheet.java:60) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.getCurrentVerificationRecord(VerificationRecordCalc Sheet.java:34) at com.pepsico.mya.bonus.struts.verification.ViewVerificationSheetAction.execute(ViewVerificationSheetAction.java:168) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.RoleModeFilter.doFilter(RoleModeFilter.java:44) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.security.SecurityContextFilter.doFilter(SecurityContextFilter.java:138) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.LocaleFilter.doFilter(LocaleFilter.java:59) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:86) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.SessionSettingsFilter.doFilter(SessionSettingsFilter.java:187) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:8 1) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436) at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451) at java.lang.Thread.run(Thread.java:662) Caused by: org.jboss.util.NestedSQLException: Unable to get managed connection for jdbc/mya/bonusPool; - nested throwable: (javax.re source.ResourceException: Unable to get managed connection for jdbc/mya/bonusPool) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java :82) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) ... 84 more Caused by: javax.resource.ResourceException: Unable to get managed connection for jdbc/mya/bonusPool at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:441) at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:424) at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496) at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManag er2.java:941) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89) ... 86 more Caused by: javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 50000 [ms] ) at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:311) at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:69 0) at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404) ... 90 more 2012-05-19 03:36:46,258 ERROR [com.pepsico.mya.bonus.exception.ApplicationException] (ajp-lrhisa02.hewitt.com%2F10.20.95.36-12002-17 6) Entity is still being used in the application. 2012-05-19 03:36:46,262 ERROR [com.pepsico.mya.bonus.exception.BusinessException] (ajp-lrhisa02.hewitt.com%2F10.20.95.36-12002-176) Entity is still being used in the application. 2012-05-19 03:36:40,158 ERROR [com.pepsico.mya.bonus.struts.calcsheet.CalculationSheetLoadAction] (ajp-lrhisa02.hewitt.com%2F10.20.9 5.36-12002-156) Unable to create verification record sheet org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.loadCollectionBatch(Loader.java:2057) at org.hibernate.loader.collection.BatchingCollectionInitializer.initialize(BatchingCollectionInitializer.java:70) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventL istener.java:83) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1744) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108) at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.populateBonusRecordDetails(VerificationRecordCalcSh eet.java:153) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.getEmployeeRecordsFromForecast(VerificationRecordCa lcSheet.java:60) at com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.getCurrentVerificationRecord(VerificationRecordCalc Sheet.java:34) at com.pepsico.mya.bonus.struts.verification.ViewVerificationSheetAction.execute(ViewVerificationSheetAction.java:168) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1078) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:295) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:396) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:347) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.RoleModeFilter.doFilter(RoleModeFilter.java:44) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.security.SecurityContextFilter.doFilter(SecurityContextFilter.java:138) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.LocaleFilter.doFilter(LocaleFilter.java:59) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:86) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.pepsico.mya.bonus.webapp.SessionSettingsFilter.doFilter(SessionSettingsFilter.java:187) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) Caused by: org.jboss.util.NestedSQLException: Unable to get managed connection for jdbc/mya/bonusPool; - nested throwable: (javax.re source.ResourceException: Unable to get managed connection for jdbc/mya/bonusPool) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java :82) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) ... 99 more Caused by: javax.resource.ResourceException: Unable to get managed connection for jdbc/mya/bonusPool at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:441) at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:424) at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496) at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManag er2.java:941) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89) ... 101 more Caused by: javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 50000 [ms] ) at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:311) at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:69 0) at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404) ... 105 more 2012-05-19 03:36:40,198 ERROR [com.pepsico.mya.bonus.struts.calcsheet.CalculationSheetLoadAction] (ajp-lrhisa02.hewitt.com%2F10.20.9 5.36-12002-140) Unable to create verification record sheet org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.loadCollectionBatch(Loader.java:2057) at org.hibernate.loader.collection.BatchingCollectionInitializer.initialize(BatchingCollectionInitializer.java:70) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventL istener.java:83) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1744) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108) at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272) Please provide some resolution for troubleshooting.

    Hibernate JIRA | 5 years ago | shirishmaurya
    org.hibernate.exception.GenericJDBCException: Cannot open connection
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    cannot get connection: general error

    Stack Overflow | 2 years ago
    org.hibernate.exception.GenericJDBCException: Cannot open connection
  6. 0

    GenericJDBCException: could not initialize a collection:

    Stack Overflow | 3 years ago | AdiB
    org.hibernate.exception.GenericJDBCException: could not initialize a collection: [.......]

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.exception.GenericJDBCException

      Cannot open connection

      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException()
    2. Hibernate
      AbstractCollectionPersister.initialize
      1. org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
      2. org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
      3. org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      4. org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
      5. org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
      6. org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
      7. org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
      8. org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577)
      9. org.hibernate.loader.Loader.doQuery(Loader.java:696)
      10. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
      11. org.hibernate.loader.Loader.loadCollectionBatch(Loader.java:2057)
      12. org.hibernate.loader.collection.BatchingCollectionInitializer.initialize(BatchingCollectionInitializer.java:70)
      13. org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587)
      13 frames
    3. Hibernate
      PersistentBag.iterator
      1. org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
      2. org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1744)
      3. org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366)
      4. org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
      5. org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272)
      5 frames
    4. com.pepsico.mya
      ViewVerificationSheetAction.execute
      1. com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.populateBonusRecordDetails(VerificationRecordCalcSheet.java:153)
      2. com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.getEmployeeRecordsFromForecast(VerificationRecordCalcSheet.java:60)
      3. com.pepsico.mya.bonus.domain.verification.VerificationRecordCalcSheet.getCurrentVerificationRecord(VerificationRecordCalcSheet.java:34)
      4. com.pepsico.mya.bonus.struts.verification.ViewVerificationSheetAction.execute(ViewVerificationSheetAction.java:168)
      4 frames
    5. struts
      ActionServlet.doGet
      1. org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
      2. org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
      3. org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
      4. org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
      4 frames
    6. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      2 frames
    7. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    8. com.pepsico.mya
      RoleModeFilter.doFilter
      1. com.pepsico.mya.bonus.webapp.RoleModeFilter.doFilter(RoleModeFilter.java:44)
      1 frame
    9. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    10. com.pepsico.mya
      SecurityContextFilter.doFilter
      1. com.pepsico.mya.bonus.webapp.security.SecurityContextFilter.doFilter(SecurityContextFilter.java:138)
      1 frame
    11. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    12. com.pepsico.mya
      LocaleFilter.doFilter
      1. com.pepsico.mya.bonus.webapp.LocaleFilter.doFilter(LocaleFilter.java:59)
      1 frame
    13. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    14. com.pepsico.mya
      ApplicationContextFilter.doFilter
      1. com.pepsico.mya.bonus.webapp.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:86)
      1 frame
    15. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    16. com.pepsico.mya
      SessionSettingsFilter.doFilter
      1. com.pepsico.mya.bonus.webapp.SessionSettingsFilter.doFilter(SessionSettingsFilter.java:187)
      1 frame
    17. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    18. Acegi Security Core
      FilterToBeanProxy.doFilter
      1. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
      2. org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
      3. org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
      4. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      5. org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
      6. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      7. org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      8. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      9. org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      10. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      11. org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
      12. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      13. org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      14. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      15. org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
      16. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      17. org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      18. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      19. org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
      20. org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
      20 frames
    19. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    20. Hibernate
      OpenSessionInViewFilter.doFilterInternal
      1. org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
      1 frame
    21. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      1 frame
    22. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    23. JBoss Application Server Tomcat
      ReplyHeaderFilter.doFilter
      1. org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      1 frame
    24. Glassfish Core
      StandardContextValve.invoke
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      4 frames
    25. JBoss Application Server Tomcat
      SecurityContextEstablishmentValve.invoke
      1. org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
      2. org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
      3. org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      4. org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      4 frames
    26. Glassfish Core
      ErrorReportValve.invoke
      1. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      2. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      2 frames
    27. JBoss Application Server Tomcat
      CachedConnectionValve.invoke
      1. org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
      1 frame
    28. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      2. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      2 frames
    29. org.apache.coyote
      AjpProtocol$AjpConnectionHandler.process
      1. org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)
      2. org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)
      2 frames
    30. Grizzly HTTP
      JIoEndpoint$Worker.run
      1. org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
      1 frame
    31. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:662)
      1 frame