Git Product home page Git Product logo

Comments (4)

stevesaliman avatar stevesaliman commented on July 25, 2024

I'll keep an eye out for the next release to see if CORE-3343 gets resolved.

In the meantime, if the issue is truly fixed in the master branch, there are a couple of workarounds you could try...

Option 1:

  1. If you're the only one building your project, you can simply clone the master branch and run mvn -DskipTests install to install the latest Liquibase to your local maven "repository"

  2. Add mavenLocal() to your build.gradle in all the places that currently have mavenCentral(), making sure that mavenLocal comes before mavenCentral()

  3. Change the liquibaseRuntime Liquibase dependency to whatever version is in the Liquibase pom.xml.

Option 2:
If more than one person is building your project, you'll need to do the same things as option 1, but with an extra step to upload your version of Liquibase to a shared repository. That repository would then need to be added to build.gradle, but instead of mavenLocal(), you'd have maven { url "http://myhost.mycompany.com/repo" }

from liquibase-gradle-plugin.

jozefmorvay avatar jozefmorvay commented on July 25, 2024

I am building it alone, so option 1 it is. Your suggested solution appears to have work, the URI exception is now gone. It still doesn't work ,though:

Unexpected error running Liquibase: java.lang.NullPointerException
liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: java.lang.NullPointerException
	at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLineUtils.java:200)
	at liquibase.integration.commandline.Main.doMigration(Main.java:1004)
	at liquibase.integration.commandline.Main.lambda$run$0(Main.java:187)
	at liquibase.Scope.child(Scope.java:125)
	at liquibase.Scope.child(Scope.java:106)
	at liquibase.Scope.child(Scope.java:138)
	at liquibase.Scope.child(Scope.java:142)
	at liquibase.integration.commandline.Main.run(Main.java:186)
	at liquibase.integration.commandline.Main.main(Main.java:125)
Caused by: liquibase.command.CommandExecutionException: java.lang.NullPointerException
	at liquibase.command.AbstractCommand.execute(AbstractCommand.java:24)
	at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLineUtils.java:198)
	... 8 common frames omitted
Caused by: java.lang.NullPointerException: null
	at liquibase.snapshot.jvm.JdbcSnapshotGenerator.getDatabaseCatalogNames(JdbcSnapshotGenerator.java:147)
	at liquibase.snapshot.jvm.CatalogSnapshotGenerator.snapshotObject(CatalogSnapshotGenerator.java:34)
	at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:66)
	at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
	at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:286)
	at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:96)
	at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:59)
	at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:38)
	at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:215)
	at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:188)
	at liquibase.command.core.DiffCommand.createReferenceSnapshot(DiffCommand.java:221)
	at liquibase.command.core.DiffCommand.createDiffResult(DiffCommand.java:143)
	at liquibase.command.core.DiffCommand.run(DiffCommand.java:135)
	at liquibase.command.AbstractCommand.execute(AbstractCommand.java:19)
	... 9 common frames omitted

This is caused by some weird class, which I do not understand the purpose of. It just returns null/0/false for everything. So then I tried removing

referenceDriver 'liquibase.ext.hibernate.database.connection.HibernateDriver'

and replaced the line with:

driver 'org.postgresql.Driver'

But that amounted to getting a new exception instead:

Unexpected error running Liquibase: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:spring:sk.imuna.warehouse.db?dialect=org.hibernate.dialect.PostgreSQL94Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy)
liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:spring:sk.imuna.warehouse.db?dialect=org.hibernate.dialect.PostgreSQL94Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy)
	at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:131)
	at liquibase.integration.commandline.Main.createReferenceDatabaseFromCommandParams(Main.java:1407)
	at liquibase.integration.commandline.Main.doMigration(Main.java:1005)
	at liquibase.integration.commandline.Main.lambda$run$0(Main.java:187)
	at liquibase.Scope.child(Scope.java:125)
	at liquibase.Scope.child(Scope.java:106)
	at liquibase.Scope.child(Scope.java:138)
	at liquibase.Scope.child(Scope.java:142)
	at liquibase.integration.commandline.Main.run(Main.java:186)
	at liquibase.integration.commandline.Main.main(Main.java:125)
Caused by: liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:spring:sk.imuna.warehouse.db?dialect=org.hibernate.dialect.PostgreSQL94Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy)
	at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:247)
	at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:142)
	at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:96)
	... 9 common frames omitted
Caused by: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:spring:sk.imuna.warehouse.db?dialect=org.hibernate.dialect.PostgreSQL94Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy)
	at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:193)
	... 11 common frames omitted

No idea what that means since postgre driver is clearly listed as a liquibaseRuntime dependency, and I have seen other liquibase configurations that looked just like mine and worked.

Anyway, this is just me ranting, your suggestion was helpful. The follow up problems are not related to this issue, or the plugin in general.

from liquibase-gradle-plugin.

Kr0oked avatar Kr0oked commented on July 25, 2024

The issue got resolved in Liquibase 3.6.3. You can find a working example in my repo. You just have to use the following:

liquibaseRuntime 'org.liquibase:liquibase-core:3.6.3'

from liquibase-gradle-plugin.

jozefmorvay avatar jozefmorvay commented on July 25, 2024

@Kr0oked very cool. it works now.

from liquibase-gradle-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.