When I compile and run native code ./gradlew nativeRun I expect the application will start, run migrations and will be prepared to incomming requests.
Actual Behaviour
When the native compiled application starts it fails with Error:
22:32:19.923 [main] ERROR io.micronaut.runtime.Micronaut - Error starting Micronaut server: Bean definition [javax.sql.DataSource] could not be loaded: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.flywaydb.database.postgresql.PostgreSQLConfigurationExtension and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
io.micronaut.context.exceptions.BeanInstantiationException: Bean definition [javax.sql.DataSource] could not be loaded: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.flywaydb.database.postgresql.PostgreSQLConfigurationExtension and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:2003)
at io.micronaut.context.DefaultApplicationContext.initializeContext(DefaultApplicationContext.java:294)
at io.micronaut.context.DefaultBeanContext.readAllBeanDefinitionClasses(DefaultBeanContext.java:3384)
at io.micronaut.context.DefaultBeanContext.finalizeConfiguration(DefaultBeanContext.java:3739)
at io.micronaut.context.DefaultBeanContext.start(DefaultBeanContext.java:363)
at io.micronaut.context.DefaultApplicationContext.start(DefaultApplicationContext.java:202)
at io.micronaut.runtime.Micronaut.start(Micronaut.java:74)
at io.micronaut.runtime.Micronaut.run(Micronaut.java:328)
at io.micronaut.runtime.Micronaut.run(Micronaut.java:303)
at com.qapil.investiq.ApplicationKt.main(Application.kt:6)
If I downgrade the flyway-core to version 9.22.3 (by adding dependency implementation("org.flywaydb:flyway-core:9.22.3!!")) and compile again it starts to work again.
Steps To Reproduce
Add dependencies to migronaut-flyway and flyway-database-postgresql
start postgresql database and set datasource in application.properties to point to the postgresql database
Expected Behavior
I have following dependencies in build.gradle
When I compile and run native code
./gradlew nativeRun
I expect the application will start, run migrations and will be prepared to incomming requests.Actual Behaviour
When the native compiled application starts it fails with Error:
If I downgrade the flyway-core to version 9.22.3 (by adding dependency
implementation("org.flywaydb:flyway-core:9.22.3!!")
) and compile again it starts to work again.Steps To Reproduce
Environment Information
Example Application
No response
Version
4.3.6