druid报错Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; loopWaitCount 0

周勇god 发布于 2013/11/20 18:49
阅读 3K+
收藏 0

运行时间长报错,重启服务器后正常。

@wenshao

Caused by: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; loopWaitCount 0, wait millis 60001; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: loopWaitCount 0, wait millis 60001

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:425)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:411)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:410)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)

at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:73)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)

at sun.reflect.GeneratedMethodAccessor1048.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:311)


... 33 more
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: loopWaitCount 0, wait millis 60001
at com.alibaba.druid.pool.DruidDataSource.pollLast(DruidDataSource.java:1340)
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1008)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:891)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4534)
at com.alibaba.druid.filter.logging.LogFilter.dataSource_getConnection(LogFilter.java:808)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4530)
at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:661)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4530)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:873)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:865)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:91)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:74)
at $Proxy7.prepareStatement(Unknown Source)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:405)

... 60 more


调用的代码片段:

returnMap = (Map<String, String>) this.getReadDao().getHibernateTemplate()
.execute(new HibernateCallback() {
@SuppressWarnings("deprecation")
public Object doInHibernate(Session session)

麻烦温少给看看,谢谢,druid版本druid-0.2.21.jar

加载中
0
村干部
村干部
用druid-0.2.9.jar,我就是用的这个,没出过问题
返回顶部
顶部