hibernate - SQLNonTransientConnectionException: Could not create connection to database server -
facing following problem: fine server connection until decided use c3p0 connection pooling. (sometimes) sqlnontransientconnectionexception occurs because new resources couldn't acquired after 30 acquisition attempts. behavior of pretty random, because times when locally restart server refuses build because there no connection found. have way instantiate entitymanagerfactory? happy type of help
`warnung: com.mchange.v2.resourcepool.basicresourcepool$scatteredacquiretask@4ff43e8a -- acquisition attempt failed!!! clearing pending acquires. while trying acquire needed new resource, failed succeed more maximum number of allowed acquisition attempts (30). last acquisition attempt exception:java.sql.sqlnontransientconnectionexception: not create connection database server. @ com.mysql.cj.jdbc.exceptions.sqlerror.createsqlexception(sqlerror.java:550) @ com.mysql.cj.jdbc.exceptions.sqlerror.createsqlexception(sqlerror.java:537) @ com.mysql.cj.jdbc.exceptions.sqlerror.createsqlexception(sqlerror.java:527) @ com.mysql.cj.jdbc.exceptions.sqlerror.createsqlexception(sqlerror.java:512) @ com.mysql.cj.jdbc.exceptions.sqlerror.createsqlexception(sqlerror.java:480) @ com.mysql.cj.jdbc.connectionimpl.connectonetryonly(connectionimpl.java:1807) @ com.mysql.cj.jdbc.connectionimpl.createnewio(connectionimpl.java:1624) @ com.mysql.cj.jdbc.connectionimpl.<init>(connectionimpl.java:637) @ com.mysql.cj.jdbc.connectionimpl.getinstance(connectionimpl.java:351) @ com.mysql.cj.jdbc.nonregisteringdriver.connect(nonregisteringdriver.java:224) @ com.mchange.v2.c3p0.drivermanagerdatasource.getconnection(drivermanagerdatasource.java:146) @ com.mchange.v2.c3p0.wrapperconnectionpooldatasource.getpooledconnection(wrapperconnectionpooldatasource.java:195) @ com.mchange.v2.c3p0.wrapperconnectionpooldatasource.getpooledconnection(wrapperconnectionpooldatasource.java:184) @ com.mchange.v2.c3p0.impl.c3p0pooledconnectionpool$1pooledconnectionresourcepoolmanager.acquireresource(c3p0pooledconnectionpool.java:200) @ com.mchange.v2.resourcepool.basicresourcepool.doacquire(basicresourcepool.java:1086) @ com.mchange.v2.resourcepool.basicresourcepool.doacquireanddecrementpendingacquireswithinlockonsuccess(basicresourcepool.java:1073) @ com.mchange.v2.resourcepool.basicresourcepool.access$800(basicresourcepool.java:44) @ com.mchange.v2.resourcepool.basicresourcepool$scatteredacquiretask.run(basicresourcepool.java:1810) @ com.mchange.v2.async.threadpoolasynchronousrunner$poolthread.run(threadpoolasynchronousrunner.java:648) caused by: java.lang.arrayindexoutofboundsexception`
persistence.xml
<property name="hibernate.c3p0.min_size" value="5"/> <property name="hibernate.c3p0.max_size" value="20"/> <property name="hibernate.c3p0.timeout" value="3000"/> <property name="hibernate.c3p0.max_statements" value="100"/> <property name="hibernate.c3p0.idle_test_period" value="300"/> <property name="hibernate.c3p0.numhelperthreads" value="8"/> <property name="hibernate.c3p0.testconnectiononcheckout" value="true"/>
edit 1: full stacktrace
java.sql.sqlnontransientconnectionexception: not create connection database server. @ com.mysql.cj.jdbc.exceptions.sqlerror.createsqlexception(sqlerror.java:550) @ com.mysql.cj.jdbc.exceptions.sqlerror.createsqlexception(sqlerror.java:537) @ com.mysql.cj.jdbc.exceptions.sqlerror.createsqlexception(sqlerror.java:527) @ com.mysql.cj.jdbc.exceptions.sqlerror.createsqlexception(sqlerror.java:512) @ com.mysql.cj.jdbc.exceptions.sqlerror.createsqlexception(sqlerror.java:480) @ com.mysql.cj.jdbc.connectionimpl.connectonetryonly(connectionimpl.java:1807) @ com.mysql.cj.jdbc.connectionimpl.createnewio(connectionimpl.java:1624) @ com.mysql.cj.jdbc.connectionimpl.<init>(connectionimpl.java:637) @ com.mysql.cj.jdbc.connectionimpl.getinstance(connectionimpl.java:351) @ com.mysql.cj.jdbc.nonregisteringdriver.connect(nonregisteringdriver.java:224) @ com.mchange.v2.c3p0.drivermanagerdatasource.getconnection(drivermanagerdatasource.java:175) @ com.mchange.v2.c3p0.wrapperconnectionpooldatasource.getpooledconnection(wrapperconnectionpooldatasource.java:220) @ com.mchange.v2.c3p0.wrapperconnectionpooldatasource.getpooledconnection(wrapperconnectionpooldatasource.java:206) @ com.mchange.v2.c3p0.impl.c3p0pooledconnectionpool$1pooledconnectionresourcepoolmanager.acquireresource(c3p0pooledconnectionpool.java:203) @ com.mchange.v2.resourcepool.basicresourcepool.doacquire(basicresourcepool.java:1138) @ com.mchange.v2.resourcepool.basicresourcepool.doacquireanddecrementpendingacquireswithinlockonsuccess(basicresourcepool.java:1125) @ com.mchange.v2.resourcepool.basicresourcepool.access$700(basicresourcepool.java:44) @ com.mchange.v2.resourcepool.basicresourcepool$scatteredacquiretask.run(basicresourcepool.java:1870) @ com.mchange.v2.async.threadpoolasynchronousrunner$poolthread.run(threadpoolasynchronousrunner.java:696) caused by: java.lang.arrayindexoutofboundsexception: 24 @ com.mysql.cj.mysqla.io.buffer.readinteger(buffer.java:271) @ com.mysql.cj.mysqla.io.mysqlacapabilities.setinitialhandshakepacket(mysqlacapabilities.java:62) @ com.mysql.cj.mysqla.io.mysqlaprotocol.readservercapabilities(mysqlaprotocol.java:434) @ com.mysql.cj.mysqla.io.mysqlaprotocol.beforehandshake(mysqlaprotocol.java:359) @ com.mysql.cj.mysqla.io.mysqlaprotocol.connect(mysqlaprotocol.java:1359) @ com.mysql.cj.mysqla.mysqlasession.connect(mysqlasession.java:132) @ com.mysql.cj.jdbc.connectionimpl.connectonetryonly(connectionimpl.java:1754) ... 13 more [c3p0pooledconnectionpoolmanager[identitytoken->1hge1tv9nk20xsdnfi9dv|6f911326]-helperthread-#0] warn com.mchange.v2.resourcepool.basicresourcepool - having failed acquire resource, com.mchange.v2.resourcepool.basicresourcepool@55d58825 interrupting threads waiting on resource check out. try again in response new client requests.
edit 2: moved configuration persistence.xml c3p0-config.xml
<c3p0-config> <default-config> <property name="automatictesttable">con_test</property> <property name="checkouttimeout">30000</property> <property name="idleconnectiontestperiod">30</property> <property name="initialpoolsize">10</property> <property name="maxidletime">30</property> <property name="maxpoolsize">100</property> <property name="initialpoolsize">20</property> <property name="minpoolsize">10</property> <property name="maxstatements">200</property> <user-overrides user="test-user"> <property name="maxpoolsize">10</property> <property name="minpoolsize">1</property> <property name="maxstatements">0</property> </user-overrides> </default-config>
Comments
Post a Comment