Database connectivity

I am having problem in creating database connectivity. Tried both MYSQL as well as SQLSERVER and both are showing same error as.
"Cannot create PoolableConnectionFactory (java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long) "

I never had problem with 32 bit OS, but some how 64 bit is giving trouble.

OS- Windows Server 2016
Ignition Server 7.5.14
MySQL Server 8.0
JAVA 7 update 72

Any idea what could be the problems?

You need to upgrade your MySQL JDBC driver to use MySQL 8.0.

I think this requires at least Java 8, though.

Kevin, I updated the driver to 8.0 under ingition database driver…

  • mysql-connector-java-8.0.15.jar
    But still error is same…

’
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long)

org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)

org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)

com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:194)

com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:150)

com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer.run(DatasourceManagerImpl.java:1108)

java.lang.Thread.run(Thread.java:745)

java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long

com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)

com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)

com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)

com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)

com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1062)

com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3556)

com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2513)

com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2283)

com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:822)

com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)

sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

java.lang.reflect.Constructor.newInstance(Constructor.java:526)

com.mysql.jdbc.Util.handleNewInstance(Util.java:411)

com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404)

com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)

org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)

org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)

org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)

org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)

org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)

com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:194)

com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:150)

com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer.run(DatasourceManagerImpl.java:1108)

java.lang.Thread.run(Thread.java:745)

java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long

com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1007)

com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3556)

com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2513)

com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2283)

com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:822)

com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)

sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

java.lang.reflect.Constructor.newInstance(Constructor.java:526)

com.mysql.jdbc.Util.handleNewInstance(Util.java:411)

com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404)

com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)

org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)

org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)

org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)

org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)

org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)

com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:194)

com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:150)

com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer.run(DatasourceManagerImpl.java:1108)

java.lang.Thread.run(Thread.java:745)

See if this KB article helps: https://support.inductiveautomation.com/index.php?/Knowledgebase/Article/View/125/0/connection-errors-when-configuring-mysql-80-database-in-ignition

Kevin, Appreciate your input and issue has been resolved.
The actual problem was rewriting the whole database version while i was restoring the gateway back up from my previous project. Even though i downloaded Ignitiion server 7.9, which has MYSQL version 8.11, it automatically restored back to the version that i was using with my previous server. I did not notice this. So, i had to reconfigure one by one rather than restoring the gateway back up.
Is there any way to upload or restore only the configurations than the drivers from a previous project…

3 Likes

No, the JDBC drivers are part of the backup. In most cases that’s actually the desired behavior.