5 Replies Latest reply on Dec 7, 2011 3:49 AM by Nicklas Karlsson

    JDBCException: Could not open connection, but db shell show that it's connection is free

    lwen ma Newbie

      Env: JBoss AS 7.1.0.Beta1

       

      DataSource maxSize is 100, and mysql show proceslist indicate that only 10+ connection that time, log console show follow:

       

      10:31:03,326 INFO  [com.borqs.mspaces.push.ejb.ComponentPushService] (pool-6-thread-1) Service:2252,update data exception!: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
              at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1353) [hibernate-entitymanager-4.0.0.CR6.jar:]
              at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:810) [hibernate-entitymanager-4.0.0.CR6.jar:]
              at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:764) [hibernate-entitymanager-4.0.0.CR6.jar:]
              at org.jboss.as.jpa.container.AbstractEntityManager.find(AbstractEntityManager.java:219) [jboss-as-jpa-7.1.0.Beta1.jar:]
              at com.iic.mrss.push.dao.HotFileDao.getRemovedFile(HotFileDao.java:495) [mrss_ejb.jar:]
              at com.iic.mrss.push.ejb.RssPushService.rssFullTextHandler(RssPushService.java:2519) [mrss_ejb.jar:]
              at com.iic.mrss.push.ejb.RssPushService.rssUpdateData(RssPushService.java:3021) [mrss_ejb.jar:]
              at com.iic.mrss.push.ejb.ComponentPushService.doUpdateData(ComponentPushService.java:79) [mrss_ejb.jar:]
              at com.iic.mrss.push.ejb.ComponentPushService.tryToUpdateData(ComponentPushService.java:101) [mrss_ejb.jar:]
              at com.iic.mrss.push.ejb.PushTimerEjb.serviceLevelHandler(PushTimerEjb.java:735) [mrss_ejb.jar:]
              at com.iic.mrss.push.ejb.PushTimerEjb.timeoutHandler(PushTimerEjb.java:591) [mrss_ejb.jar:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_29]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_29]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_29]
              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_29]
              at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.0.Beta1.jar:]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:]
              at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:]
              at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45) [jboss-as-jpa-7.1.0.Beta1.jar:]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:]
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230) [jboss-as-ejb3-7.1.0.Beta1.jar:]
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:307) [jboss-as-ejb3-7.1.0.Beta1.jar:]
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:201) [jboss-as-ejb3-7.1.0.Beta1.jar:]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:]
              at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.0.Beta1.jar:]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:]
              at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44) [jboss-as-ee-7.1.0.Beta1.jar:]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:]
              at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.0.Beta1.jar:]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:]
              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:]
              at org.jboss.as.ejb3.component.EjbComponentInstance.invokeTimeoutMethod(EjbComponentInstance.java:76) [jboss-as-ejb3-7.1.0.Beta1.jar:]
              at org.jboss.as.ejb3.component.EjbComponentInstance.invokeTimeoutMethod(EjbComponentInstance.java:88) [jboss-as-ejb3-7.1.0.Beta1.jar:]
              at org.jboss.as.ejb3.timerservice.PooledTimedObjectInvokerImpl.callTimeout(PooledTimedObjectInvokerImpl.java:119) [jboss-as-ejb3-7.1.0.Beta1.jar:]
              at org.jboss.as.ejb3.timerservice.task.TimerTask.callTimeout(TimerTask.java:134) [jboss-as-ejb3-7.1.0.Beta1.jar:]
              at org.jboss.as.ejb3.timerservice.task.TimerTask.retryTimeout(TimerTask.java:159) [jboss-as-ejb3-7.1.0.Beta1.jar:]
              at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:120) [jboss-as-ejb3-7.1.0.Beta1.jar:]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_29]
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [:1.6.0_29]
              at java.util.concurrent.FutureTask.run(FutureTask.java:138) [:1.6.0_29]
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]
              at java.lang.Thread.run(Thread.java:662) [:1.6.0_29]
              at org.jboss.threads.JBossThread.run(JBossThread.java:122)
      Caused by: org.hibernate.exception.GenericJDBCException: Could not open connection
              at org.hibernate.exception.internal.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:148) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.exception.internal.SQLStateConverter.convert(SQLStateConverter.java:136) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:306) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.extractPhysicalConnection(ConnectionProxyHandler.java:82) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) [hibernate-core-4.0.0.CR6.jar:]
              at $Proxy43.prepareStatement(Unknown Source)    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:149) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:178) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:147) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1739) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.loader.Loader.doQuery(Loader.java:828) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.loader.Loader.loadEntity(Loader.java:2058) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3697) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:439) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:420) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:204) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:251) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:148) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:956) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.internal.SessionImpl.get(SessionImpl.java:872) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.internal.SessionImpl.get(SessionImpl.java:865) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:789) [hibernate-entitymanager-4.0.0.CR6.jar:]
              ... 43 more
      Caused by: java.sql.SQLException: javax.resource.ResourceException: Error checking for a transaction
              at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:137)
              at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:67) [hibernate-entitymanager-4.0.0.CR6.jar:]
              at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:276) [hibernate-core-4.0.0.CR6.jar:]
              at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:299) [hibernate-core-4.0.0.CR6.jar:]
              ... 68 more
      Caused by: javax.resource.ResourceException: Error checking for a transaction
              at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:361)
              at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:448)
              at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)
              ... 71 more
      Caused by: javax.resource.ResourceException: IJ000459: Transaction is not active: tx=TransactionImple < ac, BasicAction: 0:ffff0a180118:23a90071:4edecfd1:77 status: ActionStatus.ABORT_ONLY >
              at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:351)
              ... 73 more