- 浏览: 477316 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (288)
- Java (70)
- Web (11)
- JSP (18)
- JavaScript (25)
- JQuery (22)
- HTML (7)
- CSS (2)
- Struts2.X (6)
- Ibatis/Mybatis (6)
- Hibernate (4)
- Spring (8)
- Oracle (23)
- MySql (9)
- Apache (1)
- Tomcat (9)
- Weblogic (2)
- Maven (6)
- Flex (0)
- Junit (2)
- Test (1)
- SVN (6)
- GIS (3)
- Android (1)
- Eclipse (10)
- Thread (3)
- JVM (1)
- Cache (2)
- Design pattern (1)
- Nosql (3)
- Linux (10)
- Hudson/Jenkins (1)
- MQ (1)
- Network (2)
- 生活工作 (5)
- 架构师之路 (6)
- 知识精华荟萃 (9)
- Interview (13)
最新评论
-
276847139:
方法很有效,我的问题就在是在父项目的.classpa ...
手动添加Maven Dependencies -
coosummer:
推荐使用http://buttoncssgenerator.c ...
button css 样式 -
lqz2012:
DBFFileReader是外部框架里面的吧,不是JDK的。楼 ...
java读取dbf文件 -
xudongcsharp:
lx13345 写道java.lang.NoSuchMetho ...
Spring常用错误 -
lx13345:
jar是hibernate3.3GA,ehcache-1.5. ...
Spring常用错误
2012.05.11 15:44:17 INFO XmlBeanDefinitionReader(323): Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] 2012.05.11 15:44:17 INFO SQLErrorCodesFactory(128): SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase] 2012.05.11 15:44:17 WARN NewPooledConnection(486): [c3p0] A PooledConnection that has already signalled a Connection error is still in use! 2012.05.11 15:44:17 WARN NewPooledConnection(487): [c3p0] Another error has occurred [ java.sql.SQLException: 关闭的连接 ] which will not be reported to listeners! java.sql.SQLException: 关闭的连接 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208) at oracle.jdbc.driver.PhysicalConnection.getMetaData(PhysicalConnection.java:1578) at com.mchange.v2.c3p0.impl.NewProxyConnection.getMetaData(NewProxyConnection.java:674) 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.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:225) at $Proxy19.getMetaData(Unknown Source) at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:285) at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:320) at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:216) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:140) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:103) at org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:99) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212) at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:296) at com.shctc.dao.impl.BusinessInforDaoImpl.getBusinessByBrand(BusinessInforDaoImpl.java:216) at sun.reflect.GeneratedMethodAccessor108.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:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy9.getBusinessByBrand(Unknown Source) at com.shctc.action.FrontPageAction.toBusinessInfor(FrontPageAction.java:399) at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381) 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:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) at java.lang.Thread.run(Thread.java:619) 2012.05.11 15:44:17 WARN SQLErrorCodesFactory(230): Error while extracting database product name - falling back to empty error codes org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: 关闭的连接 at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:296) at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:320) at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:216) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:140) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:103) at org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:99) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212) at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:296) at com.shctc.dao.impl.BusinessInforDaoImpl.getBusinessByBrand(BusinessInforDaoImpl.java:216) at sun.reflect.GeneratedMethodAccessor108.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:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy9.getBusinessByBrand(Unknown Source) at com.shctc.action.FrontPageAction.toBusinessInfor(FrontPageAction.java:399) at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381) 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:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) at java.lang.Thread.run(Thread.java:619) Caused by: java.sql.SQLException: 关闭的连接 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208) at oracle.jdbc.driver.PhysicalConnection.getMetaData(PhysicalConnection.java:1578) at com.mchange.v2.c3p0.impl.NewProxyConnection.getMetaData(NewProxyConnection.java:674) 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.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:225) at $Proxy19.getMetaData(Unknown Source) at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:285) ... 93 more 2012.05.11 15:46:34 INFO NewPooledConnection(725): [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally. 2012.05.11 15:46:34 INFO NewPooledConnection(735): [c3p0] NewPooledConnection close Exception. java.sql.SQLException: Io 异常: Connection reset at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255) at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:481) at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:1203) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:549) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470) at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) 2012.05.11 15:46:34 WARN BasicResourcePool(972): Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@14579d java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@14579d at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:571) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470) at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) 2012.05.11 15:48:08 INFO NewPooledConnection(725): [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally. 2012.05.11 15:48:08 INFO NewPooledConnection(735): [c3p0] NewPooledConnection close Exception. java.sql.SQLException: Io 异常: Connection reset at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255) at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:481) at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:1203) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:549) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470) at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) 2012.05.11 15:48:08 WARN BasicResourcePool(972): Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@1edd808 java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@1edd808 at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:571) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470) at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
一般来将,Connection在DB端有最大空闲时间的限制。
如:mysql默认Connection在8个小时无人使用(即有线程用Connection发送了SQL),就会自动断开。而此时,你本地配置的数据库连接池,却还不知道该连接已经被数据库断开了。这样就产生了,虽然拿出了Connection却在使用时,抛出已经关闭的异常。
解决办法是为连接池加检验Connection有效性的配置。具体配置根据实际情况参考连接池配置说明来调优。
<!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。默认为:3 --> <property name="acquireIncrement">3</property> <!--定义在从数据库获取新连接失败后重复尝试的次数。默认为:30 --> <property name="acquireRetryAttempts">30</property> <!--两次连接中间隔时间,单位毫秒。默认为:1000 --> <property name="acquireRetryDelay">1000</property> <!--连接关闭时默认将所有未提交的操作回滚。默认为:false --> <property name="autoCommitOnClose">false</property> <!-- c3p0将建一张名为Test的空表,并使用其自带的查询语句进行测试。如果定义了这个参数那么属性preferredTestQuery将被忽略。你不能在这张Test表上进行任何操作,它将只供c3p0测试 使用。默认为:null --> <property name="automaticTestTable">Test</property> <!-- 获取连接失败将会引起所有等待连接池来获取连接的线程抛出异常。但是数据源仍有效保留,并在下次调用getConnection()的时候继续尝试获取连接。如果设为true,那么在尝试获取连接失败后该数据源将申明已断开并永久关闭。默认为:false --> <property name="breakAfterAcquireFailure">false</property> <!-- 当连接池用完时客户端调用getConnection()后等待获取新连接的时间,超时后将抛出SQLException,如设为0则无限期等待。单位毫秒。默认为:0 --> <property name="checkoutTimeout">100</property> <!-- 通过实现ConnectionTester或QueryConnectionTester的类来测试连接。类名需制定全路径。 默认为:com.mchange.v2.c3p0.impl.DefaultConnectionTester --> <property name="connectionTesterClassName"></property> <!--指定c3p0 libraries的路径,如果(通常都是这样)在本地即可获得那么无需设置,默认null即可 默认为:null--> <property name="factoryClassLocation">null</property> <!-- Strongly disrecommended. Setting this to true may lead to subtle and bizarre bugs. (文档原文)作者强烈建议不使用的一个属性 --> <property name="forceIgnoreUnresolvedTransactions">false</property> <!--每60秒检查所有连接池中的空闲连接。默认为:0 --> <property name="idleConnectionTestPeriod">60</property> <!--初始化时获取三个连接,取值应在minPoolSize与maxPoolSize之间。默认为:3 --> <property name="initialPoolSize">3</property> <!--最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。默认为:0 --> <property name="maxIdleTime">60</property> <!--连接池中保留的最大连接数。默认为:15 --> <property name="maxPoolSize">15</property> <!-- JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。默认为:0 --> <property name="maxStatements">100</property> <!-- maxStatementsPerConnection定义了连接池内单个连接所拥有的最大缓存statements数。默认为:0 --> <property name="maxStatementsPerConnection"></property> <!-- c3p0是异步操作的,缓慢的JDBC操作通过帮助进程完成。扩展这些操作可以有效的提升性能 通过多线程实现多个操作同时被执行。默认为:3 --> <property name="numHelperThreads">3</property> <!-- 当用户调用getConnection()时使root用户成为去获取连接的用户。主要用于连接池连接非c3p0 的数据源时。默认为:null --> <property name="overrideDefaultUser">root</property> <!--与overrideDefaultUser参数对应使用的一个参数。默认为:null--> <property name="overrideDefaultPassword">password</property> <!--密码。默认为:null--> <property name="password"></property> <!-- 定义所有连接测试都执行的测试语句。在使用连接测试的情况下这个一显著提高测试速度。注意: 测试的表必须在初始数据源的时候就存在。默认为:null --> <property name="preferredTestQuery">select id from test where id=1</property> <!--用户修改系统配置参数执行前最多等待300秒。默认为:300 --> <property name="propertyCycle">300</property> <!-- 因性能消耗大请只在需要的时候使用它。如果设为true那么在每个connection提交的时候都将校验其有效性。建议使用idleConnectionTestPeriod或automaticTestTable等方法来提升连接测试的性能。默认为:false --> <property name="testConnectionOnCheckout">false</property> <!--如果设为true那么在取得连接的同时将校验连接的有效性。默认为:false --> <property name="testConnectionOnCheckin">true</property> <!--用户名。默认为:null--> <property name="user">root</property>
发表评论
-
常见eclipse环境编译问题小结
2015-07-08 21:46 697Preferences-Installed JRES-jdk ... -
URLEncode
2014-12-29 18:53 946前言: 根据HTTP协议要求,传递参数的值中如果存在特殊字符( ... -
java日期格式小时制区别
2014-12-29 18:29 748SimpleDateFormat ss = new Sim ... -
opencsv
2014-11-11 15:50 906public class CSVDemo { publ ... -
密码学-加密解密 加签验签
2014-08-21 21:37 8887RSA: 1. 加签:用私钥加 ... -
eclipse常用插件
2014-07-27 20:49 7001 velocity 模板编辑插件 实用 http://pro ... -
互联网开发
2014-04-29 19:17 21181.设计数据库时,有时候会根据业务,为了避免表中出现冗余的字 ... -
Servlet Listener
2014-03-26 17:35 1333Listener功能 它是基于观 ... -
数据库事务
2014-03-22 09:56 810数据库事务(Database Transa ... -
java 堆与栈
2014-03-21 16:54 733栈(stack):主要保存基本类型(或者叫内置类型)(char ... -
String、StringBuilder、StringBuffer区别
2014-03-21 16:24 712String 字符串常量,不可变 StringBuffer 字 ... -
数字证书
2014-03-18 17:20 777http://blog.csdn.net/zhulinfeib ... -
fish
2014-03-18 16:48 0互联网和企业应用最大的区别在于表现层的以及业务的复杂性上面。这 ... -
系统代码基本规范
2014-03-13 22:41 0系统代码基本规范 排 ... -
try catch return
2014-03-11 16:22 746package com.java.test; impor ... -
PO/POJO/VO/BO/DAO/DTO
2013-12-26 17:12 784PO(persistant object) 持久对 ... -
servlet
2013-12-21 17:47 702用Servlet获取URL地址。在HttpServletReq ... -
native2ascii
2013-12-16 15:42 754>native2ascii 中国 \u4e2d\u5 ... -
xStream 框架
2013-12-10 15:31 768http://www.cnblogs.com/hoojo/a ... -
Bat命令学习
2013-08-22 17:33 1570基础部分: 一、基础语法: 1.批处理文件是一个“. ...
相关推荐
Delphi数据库连接池是一种高效的数据库资源管理技术,它允许应用程序在多用户环境下共享数据库连接,以提高性能并减少系统资源的消耗。连接池的核心思想是重用已建立的数据库连接,而不是每次需要时都创建新的连接,...
数据库连接池在Java中的实现是提高应用程序性能的关键技术之一,它通过复用已存在的数据库连接,避免了频繁创建和销毁连接导致的系统资源浪费。本文将深入探讨如何使用Java代码来实现一个简单的数据库连接池,并解释...
1. **初始化连接池**:在应用程序启动时,数据库连接池会自动初始化,设置初始连接数和最大连接数。初始连接数通常较小,以节省资源;最大连接数限制了同时打开的数据库连接数,防止资源耗尽。 2. **连接检查与回收...
5. 错误处理:连接池需要处理各种可能的错误,例如数据库连接失败、请求超过最大连接数等,通过异常或返回值向调用者传达错误信息。 在Linux环境下,常见的数据库API包括MySQL的C API、PostgreSQL的libpq以及ODBC...
数据库连接池是Java开发中非常重要的一个概念,它在处理大量并发访问数据库的应用场景中扮演着关键角色。本文将深入探讨数据库连接池的工作原理、重要性以及如何在Java中实现一个简单的连接池。 首先,数据库连接池...
3. **空闲连接管理**:连接池可能会有一个机制监控空闲连接,如果连接长时间未被使用,可以自动关闭,释放系统资源。这有助于保持系统的高效运行。 4. **异常处理与内存管理**:修复了"free时很慢"和"free时有内存...
数据库连接池是数据库管理中的重要概念,主要用于优化数据库操作,提高系统性能。它在应用程序和数据库之间起到资源管理和复用的作用,避免了每次数据库操作都需建立和关闭连接的开销。本文将深入探讨数据库连接池的...
### 单实例模式数据库连接池 #### 概述 单实例模式数据库连接池是一种软件设计模式,主要用于提高数据库访问效率并降低...对于需要频繁访问数据库的应用场景来说,采用单实例模式数据库连接池的设计是非常有益的。
在 web 应用程序的 context.xml 文件中,我们需要添加一个数据源链接,以便应用程序能够正确地使用数据库连接池。下面是一个示例配置: ``` name="jdbc/DBPool" type="javax.sql.DataSource" global="jdbc/...
数据库连接池在应用程序启动时预创建一定数量的数据库连接,这些连接在空闲时被存储起来,当应用程序需要与数据库交互时,可以从连接池中获取一个已经建立好的连接,而不是每次都新建。使用完毕后,连接会返回到连接...
- `maxIdle`:最大空闲连接数,即数据库连接池中最大允许保持空闲状态的连接数量。当连接数超过该数值时,超出部分的连接将被回收。设为0表示不限制。 - `maxActive`:连接池中最大的活动连接数。设为0表示不限制...
数据库连接池是现代应用程序开发中的重要组成部分,尤其是在处理大量并发请求和高效数据操作时。"DatabasePool.rar" 文件提供了一个简单的数据库连接池示例,它可以帮助我们理解如何管理和优化数据库资源,提高系统...
1. **数据库连接池概念**:数据库连接池在初始化时创建一定数量的数据库连接,并将它们存储起来。当应用程序需要连接数据库时,它会从池中借用一个连接,使用完毕后归还,而不是每次操作都新建和关闭连接。这避免了...
数据库连接池是现代Web应用程序中不可或缺的部分,它有效地管理和复用数据库连接,提高了系统的性能和资源利用率。在Java中,我们可以使用多种库来创建数据库连接池,如C3P0、DBCP、HikariCP等。本示例将重点讨论...
而`maxIdle`和`maxWait`则用于控制连接池中空闲连接的数量和获取连接的最长等待时间,这两个参数的合理设置有助于避免不必要的资源浪费。 综上所述,在实际部署和开发过程中,根据应用的具体需求调整这些参数是非常...
### Tomcat配置数据库连接池详解 #### 一、引言 在Java Web开发中,数据库连接池是一项重要的技术,能够显著提高应用性能并减少资源消耗。Tomcat作为一款广泛使用的Java应用服务器,提供了内置的数据库连接池配置...
- `initialSize`、`maxActive`、`maxIdle`和`minIdle`:控制连接池中连接的初始化大小、最大活动连接数、最大空闲连接数和最小空闲连接数。 - `maxWait`:当所有连接都已被使用时,等待新连接的最大时间。 3. 配置...
- `maxIdle`:最大空闲连接数,当连接池中的空闲连接超过这个数时,新的归还连接会被关闭。 - `minIdle`:最小空闲连接数,保证连接池不会因为空闲连接过少而影响并发性能。 - `initialSize`:初始化时创建的连接数...
2. **连接池配置**:包括最小连接数、最大连接数、超时时间等配置信息。 3. **连接获取与释放**:客户端需要连接时从连接池中获取一个空闲的连接;使用完毕后,将连接放回连接池而不是关闭它。 4. **连接状态监控**...
标题中的“Tomcat 5.5.28配置数据库连接池”是指在Apache Tomcat服务器的这个特定版本中,如何设置一个数据库连接池以优化数据库访问性能。数据库连接池是应用服务器管理数据库连接的一种机制,它能有效地复用数据库...