Springboot prompt database connection problems Connection is not available

2019-05-29 11:19:51.824 WARN 854 --- [io-8080-exec-10] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: null

2019-05-29 11:19:51.825 ERROR 854 --- [io-8080-exec-10] o.h.engine.jdbc.spi.SqlExceptionHelper : HikariPool-1 - Connection is not available, request timed out after 30004ms.
2019-05-29 11:19:51.844 ERROR 854 --- [io-8080-exec-10] o.s.b.w.servlet.support.ErrorPageFilter : Forwarding to error page from request [/aa/bb] due to exception [Unable to acquire JDBC Connection; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection]

org.springframework.dao.DataAccessResourceFailureException: Unable to acquire JDBC Connection; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:238) ~[spring-orm-5.0.8.RELEASE.jar:5.0.8.RELEASE]
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:225) ~[spring-orm-5.0.8.RELEASE.jar:5.0.8.RELEASE]

 

After Baidu, I tried many methods, including timeout modify the database:

mysql> set global wait_timeout=28800;
Query OK, 0 rows affected
mysql> show global variables like 'wait_timeout';

Including setting parameters:

spring.datasource.hikari.read-only=false
spring.datasource.hikari.connection-timeout=60000
spring.datasource.hikari.idle-timeout=60000
spring.datasource.hikari.validation-timeout=3000
spring.datasource.hikari.max-lifetime=60000
spring.datasource.hikari.login-timeout=5
spring.datasource.hikari.maximum-pool-size=60
spring.datasource.hikari.minimum-idle=10

After a variety of methods, findings may still need to add the parameter configuration can resolve this issue in the pom.xml file.

 

Guess you like

Origin www.cnblogs.com/wozijisun/p/10949415.html