Cannot convert BigInt to Long error, using Docker

Hello,

I am using Camunda from a Docker-Container, i am using release 7.7.0 by pulling it.
A seperate database is needed, for this i use the MySQL-Create-script from the 7.7.0 release.

I connect the Camunda-container to the MySQL-containter and deploy it, but the following error occured:

org.apache.tomcat.jdbc.pool.ConnectionPool.init Unable to create initial connections of pool. 
java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long

It was working earlier, but i was using a database from an earlier release and some functionality was missing. So i took equal versions to be able to use these functionalities again.

Comparing the 7.6.0. create script with the 7.7.0 create-script, i noticed a new table. ACT_HI_EXT_TASK_LOG
This includes the following column

PRIORITY_ bigint not null default 0

This is the only BigInt column that has been added in the newer release.

Am i missing something here? Or is this a bug,

greeting, Revlyn

1 Like

Same problem here. Nothing yet?

@R3vlyn could you please attach the full stack trace? Where is this exception thrown?

It was working earlier, but i was using a database from an earlier release and some functionality was missing. So i took equal versions to be able to use these functionalities again.

Sorry, I don’t fully understand this section? Which versions did you change?

@menski

Regarding the verions, i was using the :latest-tag on the container running camunda, but on the MySQL-container i ran the create-script from mysql_engine_7.6.0. and mysql_identity_7.6.0. Running the webapps didnt work properly, most likely because the database from an older release does not fully support the queries from the newest release.

So, instead of combining the latest version of camunda with the 7.6.0.-version of the mysql-create-script, i decided to use the same versions, 7.7.0.

I initiate a camunda-container as following:

 docker run -d --name camunda -p 8080:8080 --link camundadb770:db            
  -e DB_DRIVER=com.mysql.jdbc.Driver            
  -e DB_URL=jdbc:mysql://db:3306/camundabpm            
  -e DB_USERNAME=root           
  -e DB_PASSWORD=camunda           
 camunda/camunda-bpm-platform:7.7.0

This part works properly, else the “Connection refused” exception would have been thrown.

After a few seconds, the camunda-container stops working.

Full stacktrace:
camunda_container_bigint_long_fullstacktrace.txt (44.6 KB)

Thanks for the log. As this stack trace already happens before Camunda even starts I would be interested in the mysql image you are using? I assume you did not replace the mysql driver inside the Camunda container? Currently I cannot reproduce it locally.

    03-Aug-2017 07:40:27.881 SEVERE [main] org.apache.tomcat.jdbc.pool.ConnectionPool.init Unable to create initial connections of pool.
     java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
            at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1041)
            at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3481)
            at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2445)
            at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215)
            at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
            at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
            at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
            at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:307)
            at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:200)
            at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699)
            at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:633)
            at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:484)
            at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:142)
            at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:115)
            at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:102)
            at org.apache.tomcat.jdbc.pool.DataSourceFactory.createDataSource(DataSourceFactory.java:553)
            at org.apache.tomcat.jdbc.pool.DataSourceFactory.getObjectInstance(DataSourceFactory.java:241)
            at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:94)
            at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
            at org.apache.naming.NamingContext.lookup(NamingContext.java:841)
            at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
            at org.apache.naming.NamingContext.lookup(NamingContext.java:829)
            at org.apache.naming.NamingContext.lookup(NamingContext.java:166)
            at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1084)
            at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:663)
            at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:256)
            at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
            at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
            at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:761)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
            at org.apache.catalina.startup.Catalina.start(Catalina.java:625)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
    Caused by: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
            at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:992)
            ... 42 more

I pulled the camunda-image from docker and no changes have been made to the mysql-driver.

The MySQL-Image i am using is mysql:8.0.2.

Would you recommend a different one?

Thanks for the fast reply!

Camunda currently officially only supports MySQL 5.6/5.7 (see Supported Environments). We don’t test it against mysql 8, so I would assume that this could be related. In my tests I use mysql:latest which is at the moment mysql:5.7. Could you test again with a mysql 5 container?

1 Like

If you want to use mysql 8 you could try to use a mysql driver which supports mysql 8. The driver inside the container is version 5.1.21. Which seems to be not compatible with mysql 8. You replace the driver you have to replace the existing mysql connector jar in the tomcat lib folder inside the container with the new driver.

@menski
Thanks, im going to test this now, ill let you know!

Yup, this was the problem! Thanks a lot for the support! I am using 5.7.18 now and its working :slight_smile:

cheers, R3vlyn