Android Question jRDC2 error with MySQL Server 8 - Error fetching connection

Angel Garcia

Member
Licensed User
Hello,
Recently i changed my laptop to a new one and re-installed all my softwares and updated to some newer versions.
I got this error from jRDC2 connecting to a MySQL database.
I'm using MySQL server 8, and JConnector 8: mysql-connector-java-8.0.17.jar
I already opened ports 17178 inbound and outbound rules to TCP connection.
I have tried almost everything on the posted threads with no luck.
I'm using windows 10
I have the typicall error on the test connection:
RemoteServer is running (09/01/2019 19:54:35)
Error fetching connection.


Here my config.properties file:
#DATABASE CONFIGURATION
DriverClass=com.mysql.cj.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost:3306/estilista
User=XXXX
Password=XXXX
#Java server port
ServerPort=17178

Notice the DriverClass name is the new way to name it based on this oracle documentation:
https://docs.oracle.com/cd/E17952_01/connector-j-8.0-en/connector-j-8.0-en.pdf

Of course in my main module i have the line:
#AdditionalJar: mysql-connector-java-8.0.17

i think i'm missing something on the JdbcUrl ór de driver class name
Please help!


Below the full error log:

Waiting for debugger to connect...
Program started.
2019-09-01 19:54:19.359:INFO::main: Logging initialized @728ms to org.eclipse.jetty.util.log.StdErrLog
Sep 01, 2019 7:54:19 PM com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
Sep 01, 2019 7:54:20 PM com.mchange.v2.c3p0.C3P0Registry
INFO: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
2019-09-01 19:54:20.158:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 11.0.1+13
2019-09-01 19:54:20.190:INFO:eek:ejs.session:main: DefaultSessionIdManager workerName=node0
2019-09-01 19:54:20.190:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2019-09-01 19:54:20.192:INFO:eek:ejs.session:main: node0 Scavenging every 660000ms
2019-09-01 19:54:20.196:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@7283d3eb{/,file:///C:/Users/angel/Downloads/jRDC2/jRDC/Objects/www,AVAILABLE}
2019-09-01 19:54:20.199:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened C:\Users\angel\Downloads\jRDC2\jRDC\Objects\logs\b4j-2019_09_02.request.log
2019-09-01 19:54:20.210:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@6f9183fd{HTTP/1.1,[http/1.1]}{0.0.0.0:17178}
2019-09-01 19:54:20.211:INFO:eek:ejs.Server:main: Started @1590ms
Emulated network latency: 100ms
jRDC is running (version = 2.22)
Sep 01, 2019 7:54:35 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource
INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 20000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hge0w4a41ufyc7fcv9aq6|1622f1b, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge0w4a41ufyc7fcv9aq6|1622f1b, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://127.0.0.1:3306/estilista, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExcessConnect...
Sep 01, 2019 7:55:06 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@5fbd6bf8 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: The server time zone value 'Central Daylight Time (Mexico' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:827)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:447)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Central Daylight Time (Mexico' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at jdk.internal.reflect.GeneratedConstructorAccessor22.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2139)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2163)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1301)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:958)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:817)
... 12 more
Sep 01, 2019 7:55:06 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@63eef88a is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
Sep 01, 2019 7:55:07 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@607a8f82 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: The server time zone value 'Central Daylight Time (Mexico' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:827)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:447)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Central Daylight Time (Mexico' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at jdk.internal.reflect.GeneratedConstructorAccessor22.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2139)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2163)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1301)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:958)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:817)
... 12 more
Sep 01, 2019 7:55:07 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@63eef88a is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
Sep 01, 2019 7:55:07 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@667808ac -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: The server time zone value 'Central Daylight Time (Mexico' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:827)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:447)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Central Daylight Time (Mexico' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at jdk.internal.reflect.GeneratedConstructorAccessor22.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2139)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2163)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1301)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:958)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:817)
... 12 more
Sep 01, 2019 7:55:07 PM com.mchange.v2.resourcepool.BasicResourcePool
WARNING: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@63eef88a is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
 

Angel Garcia

Member
Licensed User
Myself found the answer,
Post solution here just in case someone is facing same problem.
It turned out that the new Jconnector 8 driver requires an additional parameter about the time zone of the server:
https://knowledgebase.progress.com/...8-JDBC-drivers-affecting-date-time-field-data

DriverClass=com.mysql.cj.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost:3306/estilista?serverTimezone=CST6CDT
User=XXX
Password=XXX
#Java server port
ServerPort=17178


With that aditional information the connection was succesful.
Cheers,
o_O
 
Upvote 0

garaybeto

New Member
Thanks!!!!!!!!!!!!!!!!

I have that problem to connect with dell boomi :D and it solve it i need to add "?serverTimezone=CST6CDT " at the end of the database name and it works!!!!!!!!!!!
 
Upvote 0

vvg

Member
Licensed User
Longtime User
Myself found the answer,
Post solution here just in case someone is facing same problem.
It turned out that the new Jconnector 8 driver requires an additional parameter about the time zone of the server:
https://knowledgebase.progress.com/...8-JDBC-drivers-affecting-date-time-field-data

DriverClass=com.mysql.cj.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost:3306/estilista?serverTimezone=CST6CDT
User=XXX
Password=XXX
#Java server port
ServerPort=17178


With that aditional information the connection was succesful.
Cheers,
o_O

Thanx @Angel Garcia !!
I have the same problem but when i add "?serverTimezone=CST6CDT " at the end of the database name and it works!!!!!!!!!!!
 
Upvote 0

Angel Garcia

Member
Licensed User
Glad to help, just remember there is a lot of time zone names, remember to put the correct one depending on your time zone, because when your perform queries it could fetch different datetime data +/- hours.
 
Upvote 0

yzhy-mail

Member
Hi,Angel Garcia.
Thank you so much for this message.

I spent my ages for this problem!
I use mysql sever 8, but still use the old foums method years ago. And then I have little net knowledge ,that's why I cann't get the right result.
But I have our community,and our kind friends.
Thank you Angel Garcia.You help me a lot !
 
Upvote 0
Top