Currently i am using liquibase -> 4.3.2 and mysql -> 8.0.22 for my spring boot project. I am trying to create table through liquibase. It gets excuted first time . It creates 2 database by default . 1. databasechangelog and 2. databasechangeloglock . But when i try to run again then it gives me following error :
**Caused by: java.lang.ClassCastException: class java.time.LocalDateTime cannot be cast to class java.lang.String (java.time.LocalDateTime and java.lang.String are in module java.base of loader 'bootstrap')**
Code for my db.changelog-1.0.xml :
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet id="1" author="auth1">
<sql>
CREATE TABLE user (
id BIGINT NOT NULL AUTO_INCREMENT,
fname VARCHAR(255) NOT NULL,
lname VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
number BIGINT NOT NULL,
password VARCHAR(255) NOT NULL,
role VARCHAR(255) NOT NULL,
CONSTRAINT PK_id PRIMARY KEY (id)
);
</sql>
<rollback>
DROP TABLE user;
</rollback>
</changeSet>
<changeSet id="2" author="auth1">
<sql>
CREATE TABLE plant (
plantname VARCHAR(50)
)
</sql>
<rollback>
DROP TABLE plant;
</rollback>
</changeSet>
</databaseChangeLog>
code for db.changelog-master.xml :
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<include file="/db/changelog/db.changelog-1.0.xml"></include>
</databaseChangeLog>
application properties
spring.application.name = Cleandrop-Backend
spring.datasource.url = jdbc:mysql://localhost:3306/cleandrop?useUnicode=true&userLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true&useSSL=true
spring.datasource.username = root
spring.datasource.password = 1234
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.hibernate.ddl-auto=none
spring.liquibase.change-log=classpath:/db/changelog/db.changelog-master.xml
serverTimeZone=user-defined-time-zone
I also tried to change mysql version still same. How can i solve this?