数据库连接报错CannotGetJdbcConnectionException: Failed to obtain JDBC Connection

数据库连接报错CannotGetJdbcConnectionException: Failed to obtain JDBC Connection

报错信息

[Name=com.primeton.esb.online.restaurant.ms.online.mediaService.mediaService.biz][activity name=JDBC调用][activity id=invokePojo9] throw an exception:java.lang.Exception,exception :
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 5000, active 0, maxActive 100, creating 0
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:611)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:668)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:699)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:711)
	at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:782)
	at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:803)
	at com.primeton.dataservice.core.service.SqlQueryServiceImpl.findByCriteria(SqlQueryServiceImpl.java:154)
	at com.primeton.esb.online.restaurant.data.DataServiceDeal.sqlQueryPage(DataServiceDeal.java:119)
	at com.primeton.esb.online.restaurant.data.DataServiceDeal.query(DataServiceDeal.java:63)
	at com.primeton.esb.online.restaurant.data.DataServiceDeal.dataServiceOperation(DataServiceDeal.java:33)
	at com.primeton.esb.online.restaurant.ms.online.mediaService.mediaService_biz.invokePojo9(mediaService_biz.java:717)
	at com.primeton.esb.online.restaurant.ms.online.mediaService.mediaService_biz.__choiceinvokePojo9(mediaService_biz.java:1128)
	at com.primeton.esb.online.restaurant.ms.online.mediaService.mediaService_biz.__invokeBiz(mediaService_biz.java:904)
	at com.primeton.esb.online.restaurant.ms.online.mediaService.mediaService_biz._invoke(mediaService_biz.java:775)
	at com.primeton.esb.online.restaurant.ms.online.mediaService.mediaService_biz.invoke(mediaService_biz.java:820)
	at com.primeton.engine.core.impl.process.BLProxy.doInvoke(BLProxy.java:294)
	at com.primeton.engine.core.impl.process.BLProxy.asynInvoke(BLProxy.java:501)
	at com.primeton.engine.component.impl.OperationAccessor.invoke(OperationAccessor.java:228)
	at com.primeton.ext.engine.component.OperationAsyn.asynInvoke(OperationAsyn.java:33)
	at com.primeton.engine.component.impl.LogicCompoment.invokeAsyn(LogicCompoment.java:267)
	at com.primeton.access.client.impl.skeleton.BizLogicReceiveTarget.invoke(BizLogicReceiveTarget.java:64)
	at com.primeton.access.client.impl.skeleton.ServiceEngine.receive(ServiceEngine.java:36)
	at com.primeton.access.client.impl.skeleton.DefaultServiceSkeleton.invokeService(DefaultServiceSkeleton.java:130)
	at com.primeton.access.client.impl.skeleton.DefaultServiceSkeleton.invoke(DefaultServiceSkeleton.java:32)
	at com.primeton.access.client.impl.ClientMessageInterceptor.invoke(ClientMessageInterceptor.java:57)
	at com.primeton.system.aop.impl.HandlerInvoker.invoke(HandlerInvoker.java:60)
	at com.primeton.system.aop.impl.JdkProxyUtil$JdkInvocationHandlerWrapper.invoke(JdkProxyUtil.java:53)
	at com.sun.proxy.$Proxy203.invokeAsyn(Unknown Source)
	at com.primeton.esb.mediation.model.MediationService.invokeLogicFlow(MediationService.java:137)
	at com.primeton.esb.mediation.model.MediationService.messageRequest(MediationService.java:114)
	at com.primeton.esb.mediation.model.MediationService$Media_RequestHandler.handleMessage(MediationService.java:245)
	at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115)
	at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:132)
	at org.springframework.integration.dispatcher.UnicastingDispatcher.access$000(UnicastingDispatcher.java:52)
	at org.springframework.integration.dispatcher.UnicastingDispatcher$1.run(UnicastingDispatcher.java:113)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 5000, active 0, maxActive 100, creating 0
	at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1508)
	at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1253)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1233)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1223)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:90)
	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
	... 38 common frames omitted
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:335)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2187)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2220)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2015)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
	at sun.reflect.GeneratedConstructorAccessor187.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1513)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578)
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466)
Caused by: java.net.NoRouteToHostException: 没有到主机的路由
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:299)
	... 14 common frames omitted

问题原因

待确认

处理方式

待定

你可能感兴趣的:(mysql,运维,数据库,mysql)