Myeclips打开大数据量页面时出现页面错误的解决办法
以前能够正常运行的程序今天突然出现页面错误,错误日志大概如下:
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting
for
idle object
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java: 82 )
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java: 280 )
143 more
Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java: 104 )
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java: 880 )
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java: 113 )
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java: 79 )
144 more
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java: 958 )
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java: 96 )
147 more
2012 - 05 - 24 09 : 51 : 22 , 359 ERROR com.huawei.wsop.core.ExceptionAdvice - com.huawei.wsop.account.model.CustomerInfo@760c9f 执行 getCustomer 时有异常抛出.org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [ ??? ]; SQL state [ null ]; error code [ 0 ]; Cannot get a connection, pool error Timeout waiting for idle object; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
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: 424 )
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java: 410 )
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java: 424 )
at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java: 343 )
at com.huawei.wsop.account.dao.daoImpl.CustomerDaoImpl.getCustomer(CustomerDaoImpl.java: 80 )
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 39 )
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: 307 )
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java: 182 )
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java: 149 )
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java: 126 )
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java: 171 )
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java: 89 )
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java: 171 )
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java: 82 )
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java: 280 )
143 more
Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java: 104 )
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java: 880 )
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java: 113 )
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java: 79 )
144 more
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java: 958 )
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java: 96 )
147 more
2012 - 05 - 24 09 : 51 : 22 , 359 ERROR com.huawei.wsop.core.ExceptionAdvice - com.huawei.wsop.account.model.CustomerInfo@760c9f 执行 getCustomer 时有异常抛出.org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [ ??? ]; SQL state [ null ]; error code [ 0 ]; Cannot get a connection, pool error Timeout waiting for idle object; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
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: 424 )
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java: 410 )
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java: 424 )
at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java: 343 )
at com.huawei.wsop.account.dao.daoImpl.CustomerDaoImpl.getCustomer(CustomerDaoImpl.java: 80 )
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 39 )
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: 307 )
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java: 182 )
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java: 149 )
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java: 126 )
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java: 171 )
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java: 89 )
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java: 171 )
该页面共有5W多条数据,通过如下方法解决了:
在Eclipse中选择
window->preferences->myeclipse->servers->tomcat->jdk
里面有个Optional java vm arguments
在这里设置
-Xms64m -Xmx500m
xms标识最小内存 xmx标识最大,根据你服务器的情况自行设置即可.