Skip to content

Request for minimal example for integration with Spring Boot #698

Open

Description

I'm trying out Spring Boot for the first time and looking to create a minimal project which achieves the following:

  • uses Gradle+Kotlin as the build tool
  • allows liquibase to generate database changes using the JPA/Hibernate model entities I define within Spring Boot.

I appreciate this question cuts across Spring, liquibase, gradle and this plugin, but it wasn't obvious where else to ask for help with this and I think it is probably the liquibase-hibernate configuration that I ultimately need help with. And it would be a great service to newbies like myself if someone could provide a minimal working example. I've spent several days trying to achieve this with no success so far.

Thanks in advance if anyone can offer any advice.

At the moment, I get the following error when running the liquibase generateChangelog command from within Gradle:

Task :generateChangelog FAILED
liquibase-plugin: Running the 'main' activity...
May 21, 2024 12:06:53 PM liquibase.servicelocator
INFO: Cannot load service: liquibase.configuration.AutoloadedConfigurations: Provider com.datical.liquibase.ext.config.LiquibaseProConfiguration could not be instantiated
May 21, 2024 12:06:53 PM liquibase.servicelocator
INFO: Cannot load service: liquibase.configuration.AutoloadedConfigurations: Provider com.datical.liquibase.ext.config.NativeExecutorConfiguration could not be instantiated
May 21, 2024 12:06:53 PM liquibase.servicelocator
INFO: Cannot load service: liquibase.configuration.AutoloadedConfigurations: Provider com.datical.liquibase.ext.config.LiquibaseFlowConfiguration could not be instantiated
May 21, 2024 12:06:53 PM liquibase.servicelocator
INFO: Cannot load service: liquibase.configuration.AutoloadedConfigurations: Provider com.datical.liquibase.ext.config.ReportConfiguration could not be instantiated
May 21, 2024 12:06:53 PM liquibase.servicelocator
INFO: Cannot load service: liquibase.configuration.AutoloadedConfigurations: Provider com.datical.liquibase.ext.config.ExtendedLiquibaseCommandLineConfiguration could not be instantiated
May 21, 2024 12:06:53 PM liquibase.servicelocator
INFO: Cannot load service: liquibase.configuration.AutoloadedConfigurations: Provider com.datical.liquibase.ext.config.SqlplusConfiguration could not be instantiated
May 21, 2024 12:06:53 PM liquibase.servicelocator
INFO: Cannot load service: liquibase.logging.LogService: Provider com.datical.liquibase.ext.logging.structured.StructuredLogService could not be instantiated
May 21, 2024 12:06:53 PM liquibase.servicelocator
INFO: Cannot load service: liquibase.command.CommandStep: com.datical.liquibase.ext.command.RollbackOneChangesetSqlCommandStep Unable to get public no-arg constructor
Exception in thread "main" java.lang.NoClassDefFoundError: liquibase/command/CleanUpCommandStep
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:534)
	at java.base/java.lang.Class.forName(Class.java:513)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1217)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
	at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
	at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
	at liquibase.servicelocator.StandardServiceLocator.findInstances(StandardServiceLocator.java:22)
	at liquibase.command.CommandFactory.findAllInstances(CommandFactory.java:147)
	at liquibase.command.CommandFactory.getCommands(CommandFactory.java:69)
	at liquibase.integration.commandline.LiquibaseCommandLine.getCommands(LiquibaseCommandLine.java:978)
	at liquibase.integration.commandline.LiquibaseCommandLine.buildPicoCommandLine(LiquibaseCommandLine.java:202)
	at liquibase.integration.commandline.LiquibaseCommandLine.<init>(LiquibaseCommandLine.java:178)
	at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:82)
Caused by: java.lang.ClassNotFoundException: liquibase.command.CleanUpCommandStep
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
Caused by: java.lang.ClassNotFoundException: liquibase.command.CleanUpCommandStep

	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	... 33 more

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions