You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Micronaut Liquibase should work as expected when running on GraalVM native Docker images.
Actual Behaviour
Micronaut Liquibase fails to start when running on a native image. This is the error:
19:23:42.277 [main] ERROR io.micronaut.runtime.Micronaut - Error starting Micronaut server: Bean definition [javax.sql.DataSource] could not be loaded: Migration failed! Liquibase encountered an exception.
2023-02-27T19:23:42.277734425Z io.micronaut.context.exceptions.BeanInstantiationException: Bean definition [javax.sql.DataSource] could not be loaded: Migration failed! Liquibase encountered an exception.
2023-02-27T19:23:42.277741785Z at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1921)
2023-02-27T19:23:42.277745586Z at io.micronaut.context.DefaultApplicationContext.initializeContext(DefaultApplicationContext.java:249)
2023-02-27T19:23:42.277747925Z at io.micronaut.context.DefaultBeanContext.readAllBeanDefinitionClasses(DefaultBeanContext.java:3326)
2023-02-27T19:23:42.277751377Z at io.micronaut.context.DefaultBeanContext.finalizeConfiguration(DefaultBeanContext.java:3684)
2023-02-27T19:23:42.277755955Z at io.micronaut.context.DefaultBeanContext.start(DefaultBeanContext.java:341)
2023-02-27T19:23:42.277758030Z at io.micronaut.context.DefaultApplicationContext.start(DefaultApplicationContext.java:194)
2023-02-27T19:23:42.277760216Z at io.micronaut.runtime.Micronaut.start(Micronaut.java:75)
2023-02-27T19:23:42.277763874Z at com.taltous.server.Application.main(Application.kt:24)
2023-02-27T19:23:42.277767909Z Caused by: io.micronaut.runtime.exceptions.ApplicationStartupException: Migration failed! Liquibase encountered an exception.
2023-02-27T19:23:42.277770040Z at io.micronaut.liquibase.AbstractLiquibaseMigration.migrate(AbstractLiquibaseMigration.java:146)
2023-02-27T19:23:42.277772155Z at io.micronaut.liquibase.AbstractLiquibaseMigration.forceRun(AbstractLiquibaseMigration.java:100)
2023-02-27T19:23:42.277777353Z at io.micronaut.liquibase.AbstractLiquibaseMigration.run(AbstractLiquibaseMigration.java:86)
2023-02-27T19:23:42.277787673Z at io.micronaut.liquibase.LiquibaseMigrationRunner.lambda$onCreated$1(LiquibaseMigrationRunner.java:64)
2023-02-27T19:23:42.277793870Z at [email protected]/java.util.Optional.ifPresent(Optional.java:178)
2023-02-27T19:23:42.277796183Z at io.micronaut.liquibase.LiquibaseMigrationRunner.onCreated(LiquibaseMigrationRunner.java:62)
2023-02-27T19:23:42.277798248Z at io.micronaut.liquibase.LiquibaseMigrationRunner.onCreated(LiquibaseMigrationRunner.java:39)
2023-02-27T19:23:42.277800578Z at io.micronaut.context.DefaultBeanContext.triggerBeanCreatedEventListener(DefaultBeanContext.java:2407)
2023-02-27T19:23:42.277803487Z at io.micronaut.context.DefaultBeanContext.postBeanCreated(DefaultBeanContext.java:2385)
2023-02-27T19:23:42.277808952Z at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2309)
2023-02-27T19:23:42.277811874Z at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2251)
2023-02-27T19:23:42.277813833Z at io.micronaut.context.DefaultBeanContext.createRegistration(DefaultBeanContext.java:3016)
2023-02-27T19:23:42.277815844Z at io.micronaut.context.SingletonScope.getOrCreate(SingletonScope.java:80)
2023-02-27T19:23:42.277817886Z at io.micronaut.context.DefaultBeanContext.findOrCreateSingletonBeanRegistration(DefaultBeanContext.java:2918)
2023-02-27T19:23:42.277823314Z at io.micronaut.context.DefaultBeanContext.loadContextScopeBean(DefaultBeanContext.java:2737)
2023-02-27T19:23:42.277825383Z at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1915)
2023-02-27T19:23:42.277827374Z ... 7 common frames omitted
2023-02-27T19:23:42.277829357Z Caused by: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Cannot parse resource location: 'resource:/'
2023-02-27T19:23:42.277834808Z at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
2023-02-27T19:23:42.277837181Z at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:406)
2023-02-27T19:23:42.277839237Z at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:391)
2023-02-27T19:23:42.277841126Z at liquibase.Liquibase$16.run(Liquibase.java:2020)
2023-02-27T19:23:42.277846505Z at liquibase.Scope.lambda$child$0(Scope.java:180)
2023-02-27T19:23:42.277848912Z at liquibase.Scope.child(Scope.java:189)
2023-02-27T19:23:42.277850812Z at liquibase.Scope.child(Scope.java:179)
2023-02-27T19:23:42.277852695Z at liquibase.Scope.child(Scope.java:158)
2023-02-27T19:23:42.277857613Z at liquibase.Liquibase.runInScope(Liquibase.java:2445)
2023-02-27T19:23:42.277860393Z at liquibase.Liquibase.listUnrunChangeSets(Liquibase.java:2016)
2023-02-27T19:23:42.277862307Z at io.micronaut.liquibase.AbstractLiquibaseMigration.isUpdateNeeded(AbstractLiquibaseMigration.java:325)
2023-02-27T19:23:42.277871460Z at io.micronaut.liquibase.AbstractLiquibaseMigration.performUpdateIfNeeded(AbstractLiquibaseMigration.java:183)
2023-02-27T19:23:42.277874467Z at io.micronaut.liquibase.AbstractLiquibaseMigration.migrate(AbstractLiquibaseMigration.java:140)
2023-02-27T19:23:42.277876472Z ... 22 common frames omitted
Steps To Reproduce
Configure a typical Micronaut application, using Liquibase:
Expected Behavior
The Micronaut Liquibase should work as expected when running on GraalVM native Docker images.
Actual Behaviour
Micronaut Liquibase fails to start when running on a native image. This is the error:
Steps To Reproduce
implementation("io.micronaut.liquibase:micronaut-liquibase")
The notable part on
application.yml
:The
change-log.xml
:The migration files are stored using SQL scripts in the appropriate directory:
Build a native image for Docker and run the container. The application fail to start with the error mentioned above.
Note: The migrations start normally when running from Gradle, with no native image support.
Environment Information
Example Application
No response
Version
3.8.5
The text was updated successfully, but these errors were encountered: