ClassCastException During Startup with mysql-connector-java version 8.0.23

ClassCastException During Startup with mysql-connector-java version 8.0.23

Description

When starting Tomcat with mysql-connector-java version 8.0.23, the following errors can occur:

  • Change log lock is acquired and released repeatedly
  • "Error creating bean" for many named items
  • NoSuchBeanDefinitionException
  • BeanCreationException
  • ClassCastException

This issue is a result of a change made in MySQL Connector/J 8.0.23. The release notes state the following relevant change:

"a getObject(columnIndex) call on a DATETIME column returns a LocalDateTime object now instead of a String. To receive a String like before, use getObject(columnIndex, String.class) instead."

This change is causing liquibase to fail. Please refer to the following liquibase issue for more details: 
"Support drivers that return a LocalDateTime for dates" https://github.com/liquibase/liquibase/pull/1664

 

Workaround

  1. Replace the mysql-connector-java-8.0.23.jar file under <FNCI_INSTALL_DIR>/tomcat/lib with mysql-connector-java version 8.0.22 or earlier.
  2. Restart Tomcat

 

Resolution

A fix will be determined after changes have been made to liquibase or the latest MySQL connector. This issue is being tracked under Issue# SCA-32509.

Was this article helpful? Yes No
No ratings
Version history
Revision #:
3 of 5
Last update:
‎Apr 02, 2021 03:08 PM
Updated by:
 
Contributors