Why am I getting ClassCastException when running Liquibase?

132 Views Asked by At

I'm trying to configure Liquibase to work with our neo4j Aura instance. The first time I run it, it works fine, but every subsequent time I am getting this error:

[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:4.24.0:update (default) on project liquibase: 
[ERROR] Error setting up or running Liquibase:
[ERROR] java.lang.ClassCastException: class java.time.ZonedDateTime cannot be cast to class java.sql.Timestamp (java.time.ZonedDateTime is in module java.base of loader 'bootstrap'; java.sql.Timestamp is in module java.sql of loader 'platform')

The version of liquibase and the neo4j extension is 4.24.0, the plugin configuration in maven is like this:

            <plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>${liquibase.version}</version>
                <configuration>
                    <changeLogFile>liquibase/changelog.xml</changeLogFile>
                    <url>jdbc:neo4j:neo4j+s://MYAURAURL:7687</url>
                    <driver>org.neo4j.jdbc.boltrouting.BoltRoutingNeo4jDriver</driver>
                    <username>neo4j</username>
                    <password>MYAURAPASS</password>
                </configuration>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>update</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

I'm guessing it's trying to cast these that show up in the database: dateCreated: 2023-10-11T10:32:17.024000000Z dateUpdated: 2023-10-11T10:33:24.253000000Z But that isn't anything that I've defined explicitly.

I've tried running with previous versions of the liquibase plugin. It either gives the same message or doesn't run at all.

1

There are 1 best solutions below

0
fbiville On BEST ANSWER

You are using the wrong driver. It should be liquibase.ext.neo4j.database.jdbc.Neo4jDriver. I should probably rework the documentation section on this.