web-dev-qa-db-ja.com

スプリングブートでJDBCConnectionException「JDBC接続を取得できません」

Japserレポートを使用してレポートを生成すると、SpringBootは正常に機能します。

私が直面している問題は、アプリケーションが休止状態の例外をスローすることです:

JDBC接続を取得できません

レポートを何度も生成すると、このエラーが発生します。

1 running delayed actions on {type: MASTER, group: null, band: 0}
2018-09-20 14:27:55.536 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.fill.JRBaseFiller           : Fill 1: ended
2018-09-20 14:27:55.536 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.fill.JRFillDataset          : Fill 1: closing query executer
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block DEVANAGARI
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block BENGALI
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block TELUGU
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block TAMIL
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block GUJARATI
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block KANNADA
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block MALAYALAM
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block ORIYA
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block GURMUKHI
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block SINHALA
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block TIBETAN
2018-09-20 14:27:55.539 DEBUG 46148 --- [ XNIO-2 task-27] 
n.s.j.engine.export.JRPdfExporter        : glyph renderer block KHMER
2018-09-20 14:28:25.549  WARN 46148 --- [ XNIO-2 task-27] 
o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: null
2018-09-20 14:28:25.550 ERROR 46148 --- [ XNIO-2 task-27] 
o.h.engine.jdbc.spi.SqlExceptionHelper   : HikariPool-1 - Connection is not 
available, request timed out after 30000ms.
2018-09-20 14:28:25.556 ERROR 46148 --- [ XNIO-2 task-27] 
c.n.xx.aop.logging.LoggingAspect    : Exception in 
com.xx.xx.web.rest.GrueResource.generateRapportGrue() with cause = 
'org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC 
Connection' and exception = 'Could not open JPA EntityManager for 
transaction; nested exception is 
org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC 
Connection'

org.springframework.transaction.CannotCreateTransactionException: Could not 
open JPA EntityManager for transaction; nested exception is 
org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC 
Connection
3
Amir Choubani

接続が不足しています。

Hikari接続プールをより大きな数に設定してみてください。

spring.datasource.hikari.maximum-pool-size=10
3