先放异常信息:
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in com/umpay/operation/dao/db2/cashier/sqlmaps/CashierNotice.xml.
--- The error occurred while executing query.
--- Check the SELECT t.ID as id, to_char(t.INTIME, 'yyyy-MM-dd HH:mm:ss') as inTime, to_char(t.MODTIME, 'yyyy-MM-dd HH:mm:ss') as modTime, t.DETAIL as detail, t.STATUS as status, to_char(t.VALIDITY_DATE, 'yyyy-MM-dd HH:mm:ss') as validityDate FROM T_BULLETIN_BOARD t WHERE 1 = 1 .
--- Check the SQL Statement (preparation failed).
--- Cause: java.sql.SQLException: Connections could not be acquired from the underlying database!; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/umpay/operation/dao/db2/cashier/sqlmaps/CashierNotice.xml.
--- The error occurred while executing query.
--- Check the SELECT t.ID as id, to_char(t.INTIME, 'yyyy-MM-dd HH:mm:ss') as inTime, to_char(t.MODTIME, 'yyyy-MM-dd HH:mm:ss') as modTime, t.DETAIL as detail, t.STATUS as status, to_char(t.VALIDITY_DATE, 'yyyy-MM-dd HH:mm:ss') as validityDate FROM T_BULLETIN_BOARD t WHERE 1 = 1 .
--- Check the SQL Statement (preparation failed).
--- Cause: java.sql.SQLException: Connections could not be acquired from the underlying database!
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) ~[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) ~[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) ~[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:205) ~[umpay-spring-orm-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:312) ~[umpay-spring-orm-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at com.umpay.operation.dao.db2.cashier.impl.CashierNoticeDaoImpl.queryCashierNoticeList(CashierNoticeDaoImpl.java:32) ~[classes/:na]
at com.umpay.operation.ejb.cashier.CashierNoticeServiceBean.queryCashierNoticeDetail(CashierNoticeServiceBean.java:52) ~[classes/:na]
at com.alibaba.dubbo.common.bytecode.Wrapper55.invokeMethod(Wrapper55.java) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:75) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.umpay.operation.interceptor.ServiceLogInterceptor.invoke(ServiceLogInterceptor.java:125) [classes/:na]
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:98) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:132) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.common.bytecode.proxy27.queryCashierNoticeDetail(proxy27.java) [umpay-dubbo-2.5.4.jar:2.5.4]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:302) [hessian-4.0.37.jar:3.1.0]
at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:198) [hessian-4.0.37.jar:3.1.0]
at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:139) [hessian-4.0.37.jar:3.1.0]
at com.alibaba.dubbo.rpc.protocol.hessian.HessianProtocol$HessianHandler.handle(HessianProtocol.java:78) [umpay-dubbo-2.5.4.jar:2.5.4]
at com.alibaba.dubbo.remoting.http.servlet.DispatcherServlet.service(DispatcherServlet.java:64) [umpay-dubbo-2.5.4.jar:2.5.4]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770) [javax.servlet-api-3.0.1.jar:3.0.1]
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) [jetty-6.1.26.jar:6.1.26]
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401) [jetty-6.1.26.jar:6.1.26]
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) [jetty-6.1.26.jar:6.1.26]
at org.mortbay.jetty.Server.handle(Server.java:326) [jetty-6.1.26.jar:6.1.26]
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) [jetty-6.1.26.jar:6.1.26]
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) [jetty-6.1.26.jar:6.1.26]
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) [jetty-6.1.26.jar:6.1.26]
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) [jetty-6.1.26.jar:6.1.26]
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) [jetty-6.1.26.jar:6.1.26]
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) [jetty-6.1.26.jar:6.1.26]
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) [jetty-util-6.1.26.jar:6.1.26]
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/umpay/operation/dao/db2/cashier/sqlmaps/CashierNotice.xml.
--- The error occurred while executing query.
--- Check the SELECT t.ID as id, to_char(t.INTIME, 'yyyy-MM-dd HH:mm:ss') as inTime, to_char(t.MODTIME, 'yyyy-MM-dd HH:mm:ss') as modTime, t.DETAIL as detail, t.STATUS as status, to_char(t.VALIDITY_DATE, 'yyyy-MM-dd HH:mm:ss') as validityDate FROM T_BULLETIN_BOARD t WHERE 1 = 1 .
--- Check the SQL Statement (preparation failed).
--- Cause: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185) ~[umpay-ibatis-2.3.0.677.jar:na]
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123) ~[umpay-ibatis-2.3.0.677.jar:na]
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615) ~[umpay-ibatis-2.3.0.677.jar:na]
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:126) ~[umpay-ibatis-2.3.0.677.jar:na]
at org.springframework.orm.ibatis.SqlMapClientTemplate$4.doInSqlMapClient(SqlMapClientTemplate.java:314) ~[umpay-spring-orm-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.orm.ibatis.SqlMapClientTemplate$4.doInSqlMapClient(SqlMapClientTemplate.java:1) ~[umpay-spring-orm-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:202) ~[umpay-spring-orm-3.1.3.RELEASE.jar:3.1.3.RELEASE]
... 48 common frames omitted
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) ~[c3p0-0.9.1.2.jar:0.9.1.2]
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) ~[c3p0-0.9.1.2.jar:0.9.1.2]
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) ~[c3p0-0.9.1.2.jar:0.9.1.2]
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) ~[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:224) ~[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at com.sun.proxy.$Proxy21.prepareStatement(Unknown Source) ~[na:na]
at com.ibatis.sqlmap.engine.execution.SqlExecutor.prepareStatement(SqlExecutor.java:539) ~[umpay-ibatis-2.3.0.677.jar:na]
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:208) ~[umpay-ibatis-2.3.0.677.jar:na]
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205) ~[umpay-ibatis-2.3.0.677.jar:na]
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173) ~[umpay-ibatis-2.3.0.677.jar:na]
... 54 common frames omitted
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) ~[c3p0-0.9.1.2.jar:0.9.1.2]
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) ~[c3p0-0.9.1.2.jar:0.9.1.2]
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) ~[c3p0-0.9.1.2.jar:0.9.1.2]
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) ~[c3p0-0.9.1.2.jar:0.9.1.2]
... 62 common frames omitted
解决办法:
由于DB2的数据库连接地址错误;
DB2的链接非常奇葩
最开始我是这样写的
但是实际上 jdbcurl的value值,我们数据库前面的冒号 : 要换成 /
修改完 链接成功