We have an Artemis MQ instance in our QA environment that we are using to 
evaluate JDBC persistence.

It was running with Artemis 2.20, and we recently updated to 2.22. Since then 
the instance has failed to start with the following error:

2022-05-31 10:16:55,512 WARN 
[org.apache.activemq.artemis.core.server.impl.jdbc.JdbcNodeManager] Errored 
while trying to acquire lock: java.lang.IllegalStateException: 
com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect 
datetime value: '1654006615505' for column 'HOLDER_EXPIRATION_TIME' at row 1
                at 
org.apache.activemq.artemis.core.server.impl.jdbc.JdbcLeaseLock.tryAcquire(JdbcLeaseLock.java:275)
 [artemis-server-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.core.server.impl.jdbc.LeaseLock.tryAcquire(LeaseLock.java:93)
 [artemis-server-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.core.server.impl.jdbc.LeaseLock.tryAcquire(LeaseLock.java:111)
 [artemis-server-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.core.server.impl.jdbc.JdbcNodeManager.lock(JdbcNodeManager.java:284)
 [artemis-server-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.core.server.impl.jdbc.JdbcNodeManager.startLiveNode(JdbcNodeManager.java:468)
 [artemis-server-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.core.server.impl.SharedStoreLiveActivation.run(SharedStoreLiveActivation.java:86)
 [artemis-server-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:663)
 [artemis-server-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:571)
 [artemis-server-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:64) 
[artemis-cli-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:127) 
[artemis-cli-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:160) 
[artemis-cli-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:108) 
[artemis-cli-2.22.0.jar:2.22.0]
                at 
org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:135) 
[artemis-cli-2.22.0.jar:2.22.0]
                at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
[java.base:]
                at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 [java.base:]
                at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [java.base:]
                at java.base/java.lang.reflect.Method.invoke(Method.java:566) 
[java.base:]
                at 
org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:134) 
[artemis-boot.jar:2.22.0]
                at 
org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:50) 
[artemis-boot.jar:2.22.0]
Caused by: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: 
Incorrect datetime value: '1654006615505' for column 'HOLDER_EXPIRATION_TIME' 
at row 1
                at 
com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104)
 [mysql-connector-java-8.0.28.jar:8.0.28]
                at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
 [mysql-connector-java-8.0.28.jar:8.0.28]
                at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1098)
 [mysql-connector-java-8.0.28.jar:8.0.28]
                at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1046)
 [mysql-connector-java-8.0.28.jar:8.0.28]
                at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1371)
 [mysql-connector-java-8.0.28.jar:8.0.28]
                at 
com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1031)
 [mysql-connector-java-8.0.28.jar:8.0.28]
                at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
[java.base:]
                at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 [java.base:]
                at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [java.base:]
                at java.base/java.lang.reflect.Method.invoke(Method.java:566) 
[java.base:]
                at 
com.mysql.cj.jdbc.ha.MultiHostConnectionProxy$JdbcInterfaceProxy.invoke(MultiHostConnectionProxy.java:107)
 [mysql-connector-java-8.0.28.jar:8.0.28]
                at com.sun.proxy.$Proxy21.executeUpdate(Unknown Source)
                at 
org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
 [commons-dbcp2-2.7.0.jar:2.7.0]
                at 
org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
 [commons-dbcp2-2.7.0.jar:2.7.0]
                at 
org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
 [commons-dbcp2-2.7.0.jar:2.7.0]
                at 
org.apache.activemq.artemis.core.server.impl.jdbc.JdbcLeaseLock.tryAcquire(JdbcLeaseLock.java:260)
 [artemis-server-2.22.0.jar:2.22.0]
                ... 18 more

Our JDBC configuration:
<store>
        <database-store>
          
<jdbc-driver-class-name>com.mysql.cj.jdbc.Driver</jdbc-driver-class-name>
          <jdbc-user>rave</jdbc-user>
          <jdbc-password>#######</jdbc-password>
          
<jdbc-connection-url>jdbc:mysql:replication://qadb1:3306,qadb1:3306/DbArtemis?characterEncoding=UTF-8&amp;useServerPrepStmts=false&amp;rewriteBatchedStatements=true&amp;useSSL=false&amp;allowPublicKeyRetrieval=true&amp;serverTimezone=EST5EDT</jdbc-connection-url>
          <message-table-name>MESSAGES</message-table-name>
          <bindings-table-name>BINDINGS</bindings-table-name>
          <large-message-table-name>LARGE_MESSAGES</large-message-table-name>
          <page-store-table-name>PAGE_STORE</page-store-table-name>
          
<node-manager-store-table-name>NODE_MANAGER_STORE</node-manager-store-table-name>
        </database-store>
</store>

We are using mysql-connector-java-8.0.28.jar

Were there any additional steps needed for upgrading when using JDBC 
persistence, or issues with our configuration that might have led to these 
errors?

Reply via email to