question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClassCastException on moving to mysql-connector-java version 8.0.23

See original GitHub issue

Environment

Liquibase Version: 3.6.3

Liquibase Integration & Version: spring boot

Liquibase Extension(s) & Version:

Database Vendor & Version: mysql Ver 14.14 Distrib 5.7.28, for osx10.14 (x86_64) mysql-connector-java version 8.0.23

Operating System Type & Version: All

Description

While trying to move from mysql-connector-java version 8.0.18 to 8.0.23, getting an ClassCastException on bootup. Caused by: java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.lang.String at liquibase.changelog.StandardChangeLogHistoryService.getRanChangeSets(StandardChangeLogHistoryService.java:324) at liquibase.changelog.AbstractChangeLogHistoryService.upgradeChecksums(AbstractChangeLogHistoryService.java:66) at liquibase.changelog.StandardChangeLogHistoryService.upgradeChecksums(StandardChangeLogHistoryService.java:293) at liquibase.Liquibase.checkLiquibaseTables(Liquibase.java:1221) at liquibase.Liquibase.update(Liquibase.java:193) at liquibase.Liquibase.update(Liquibase.java:179) at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:353) at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:305) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1830) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1767) ... 108 common frames omitted

Steps To Reproduce (CLI)

Add the mysql-connector 8.0.23 jar to your lib directory and attempt to run liquibase operations against a mysql database.

Steps To Reproduce (Spring Boot)

List the steps to reproduce the behavior. this is the pom.xml used,


<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
	<version>8.0.23</version>
</dependency>

<dependency>
	<groupId>org.liquibase</groupId>
	<artifactId>liquibase-core</artifactId>
	<version>3.6.3</version>
</dependency>
<dependency>
	<groupId>org.liquibase.ext</groupId>
	<artifactId>liquibase-hibernate5</artifactId>
	<version>3.6</version>
	<exclusions>
		<exclusion>
			<groupId>org.hibernate.javax.persistence</groupId>
			<artifactId>hibernate-jpa-2.0-api</artifactId>
		</exclusion>
	</exclusions>
</dependency>

Liquibase Internal QA Requirements

  • Manually validate the fix with the CLi.
  • Locally execute all functional MySQL tests.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:24 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
molivasdatcommented, Jan 22, 2021

My suggestion would be to use 8.0.22 until MySQL fixes this especially if there is nothing critical in 8.0.23 that is not in 8.0.22.

4reactions
rreichcommented, May 11, 2021

Any news on 3.10.4?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ClassCastException During Startup with mysql-connector-java ...
Description When starting Tomcat with mysql-connector-java version 8.0.23 or later, the following errors can occur: Change log lock is ...
Read more >
ClassCastException: java.math.BigInteger cannot be cast to ...
The problem seems with your version of MySQL in combination with your version of mysql-connector.jar. Try a newer version of MySQL Connector/J ( ......
Read more >
class java.time.LocalDateTime cannot be cast to class java ...
we are getting error with last version to mysql-connector-java (8.0.23) and liquibase(4.3.0), when we start the spring boot application.
Read more >
7.1 Connecting to MySQL Using the JDBC DriverManager ...
The easiest way to do this is to use Class.forName() on the class that implements the java.sql.Driver interface. With MySQL Connector/J, the name...
Read more >
ClassCastException in liquibase after upgrading MySQL ...
After upgrading MySQL Connector/J to 8.0.23+, RH-SSO fails to start in liquibase. Raw. [0m [31m07:24:57,417 FATAL [org.keycloak.services] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found