Connections cocould not be acquired from the underlying database, acquiredunderlying
Unable to get the connection from the basic database, and cannot connect to the database.
Severe: StandardWrapper. Throwable
Org. springframework. transaction. CannotCreateTransactionException: cocould not open JDBC Connection for transaction; nested exception is java. SQL. SQLException: Connections cocould not be acquired from the underlying database!
At org. springframework. jdbc. datasource. DataSourceTransactionManager. doBegin (DataSourceTransactionManager. java: 241)
At org. springframework. transaction. support. AbstractPlatformTransactionManager. getTransaction (AbstractPlatformTransactionManager. java: 372)
At org. springframework. transaction. interceptor. TransactionAspectSupport. createTransactionIfNecessary (TransactionAspectSupport. java: 417)
At org. springframework. transaction. interceptor. TransactionAspectSupport. invokeWithinTransaction (TransactionAspectSupport. java: 255)
At org. springframework. transaction. interceptor. TransactionInterceptor. invoke (TransactionInterceptor. java: 94)
At org. springframework. aop. framework. ReflectiveMethodInvocation. proceed (ReflectiveMethodInvocation. java: 172)
At org. springframework. aop. framework. CglibAopProxy $ DynamicAdvisedInterceptor. intercept (CglibAopProxy. java: 633)
At com. xinghe. base. service. PlatformManager $ EnhancerBySpringCGLIB $9ad1dc7. getPlarMark (<generated>)
At com. xinghe. base. web. init. BaseDataServlet. init (BaseDataServlet. java: 73)
At org. apache. catalina. core. StandardWrapper. initServlet (StandardWrapper. java: 1284)
At org. apache. catalina. core. StandardWrapper. loadServlet (StandardWrapper. java: 1197)
At org. apache. catalina. core. StandardWrapper. load (StandardWrapper. java: 1087)
At org. apache. catalina. core. StandardContext. loadOnStartup (StandardContext. java: 5210)
At org. apache. catalina. core. StandardContext. startInternal (StandardContext. java: 5493)
At org. apache. catalina. util. LifecycleBase. start (LifecycleBase. java: 150)
At org. apache. catalina. core. ContainerBase $ StartChild. call (ContainerBase. java: 1559)
At org. apache. catalina. core. ContainerBase $ StartChild. call (ContainerBase. java: 1549)
At java. util. concurrent. FutureTask. run (Unknown Source)
At java. util. concurrent. ThreadPoolExecutor. runWorker (Unknown Source)
At java. util. concurrent. ThreadPoolExecutor $ Worker. run (Unknown Source)
At java. lang. Thread. run (Unknown Source)
Caused by: java. SQL. SQLException: Connections cocould not be acquired from the underlying database!
At com. mchange. v2. SQL. SqlUtils. toSQLException (SqlUtils. java: 106)
At com. mchange. v2.c3p0. impl. C3P0PooledConnectionPool. checkoutPooledConnection (C3P0PooledConnectionPool. java: 529)
At com. mchange. v2.c3p0. impl. AbstractPoolBackedDataSource. getConnection (AbstractPoolBackedDataSource. java: 128)
At org. springframework. jdbc. datasource. lookup. AbstractRoutingDataSource. getConnection (AbstractRoutingDataSource. java: 162)
At org. springframework. jdbc. datasource. DataSourceTransactionManager. doBegin (DataSourceTransactionManager. java: 203)
... 20 more
Caused by: com. mchange. v2.resourcepool. CannotAcquireResourceException: A ResourcePool cocould not acquire a resource from its primary factory or source.
At com. mchange. v2.resourcepool. BasicResourcePool. awaitAvailable (BasicResourcePool. java: 1319)
At com. mchange. v2.resourcepool. BasicResourcePool. prelimCheckoutResource (BasicResourcePool. java: 557)
At com. mchange. v2.resourcepool. BasicResourcePool. checkoutResource (BasicResourcePool. java: 477)
At com. mchange. v2.c3p0. impl. C3P0PooledConnectionPool. checkoutPooledConnection (C3P0PooledConnectionPool. java: 525)
... 23 more
December 27 4:00:54 org. apache. catalina. core. StandardContext loadOnStartup
Severe: Servlet/xunghe-web threw load () exception
Com. mchange. v2.resourcepool. CannotAcquireResourceException: A ResourcePool cocould not acquire a resource from its primary factory or source.
At com. mchange. v2.resourcepool. BasicResourcePool. awaitAvailable (BasicResourcePool. java: 1319)
At com. mchange. v2.resourcepool. BasicResourcePool. prelimCheckoutResource (BasicResourcePool. java: 557)
At com. mchange. v2.resourcepool. BasicResourcePool. checkoutResource (BasicResourcePool. java: 477)
At com. mchange. v2.c3p0. impl. C3P0PooledConnectionPool. checkoutPooledConnection (C3P0PooledConnectionPool. java: 525)
At com. mchange. v2.c3p0. impl. AbstractPoolBackedDataSource. getConnection (AbstractPoolBackedDataSource. java: 128)
At org. springframework. jdbc. datasource. lookup. AbstractRoutingDataSource. getConnection (AbstractRoutingDataSource. java: 162)
At org. springframework. jdbc. datasource. DataSourceTransactionManager. doBegin (DataSourceTransactionManager. java: 203)
At org. springframework. transaction. support. AbstractPlatformTransactionManager. getTransaction (AbstractPlatformTransactionManager. java: 372)
At org. springframework. transaction. interceptor. TransactionAspectSupport. createTransactionIfNecessary (TransactionAspectSupport. java: 417)
At org. springframework. transaction. interceptor. TransactionAspectSupport. invokeWithinTransaction (TransactionAspectSupport. java: 255)
At org. springframework. transaction. interceptor. TransactionInterceptor. invoke (TransactionInterceptor. java: 94)
At org. springframework. aop. framework. ReflectiveMethodInvocation. proceed (ReflectiveMethodInvocation. java: 172)
At org. springframework. aop. framework. CglibAopProxy $ DynamicAdvisedInterceptor. intercept (CglibAopProxy. java: 633)
At com. xinghe. base. service. PlatformManager $ EnhancerBySpringCGLIB $9ad1dc7. getPlarMark (<generated>)
At com. xinghe. base. web. init. BaseDataServlet. init (BaseDataServlet. java: 73)
At org. apache. catalina. core. StandardWrapper. initServlet (StandardWrapper. java: 1284)
At org. apache. catalina. core. StandardWrapper. loadServlet (StandardWrapper. java: 1197)
At org. apache. catalina. core. StandardWrapper. load (StandardWrapper. java: 1087)
At org. apache. catalina. core. StandardContext. loadOnStartup (StandardContext. java: 5210)
At org. apache. catalina. core. StandardContext. startInternal (StandardContext. java: 5493)
At org. apache. catalina. util. LifecycleBase. start (LifecycleBase. java: 150)
At org. apache. catalina. core. ContainerBase $ StartChild. call (ContainerBase. java: 1559)
At org. apache. catalina. core. ContainerBase $ StartChild. call (ContainerBase. java: 1549)
At java. util. concurrent. FutureTask. run (Unknown Source)
At java. util. concurrent. ThreadPoolExecutor. runWorker (Unknown Source)
At java. util. concurrent. ThreadPoolExecutor $ Worker. run (Unknown Source)
At java. lang. Thread. run (Unknown Source)
The above problems may be caused by the following reasons:
1. driver configuration error: Driver = com. mysql. jdbc. driver
2. The database connection address is incorrect: url = jdbc: mysql: // localhost: 3306/test? 3 useUnicode = true & characterEncoding = utf8
3. Incorrect password or account: username = root,Password = root
4. The database is not started or has no access permission
5. The project did not introduce the corresponding driver jar package mysql-connector-java-5.1.6-bin.jar
6. mysql root does not have the permission for remote access. To add the permission, follow these steps::
Enter the mysql database:
Grant all privileges on *. * to 'root' @ '%' identified by 'root' with grant option;
Flush privileges;