Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquibase Yaml + SQL isn't working in native image #125

Closed
nkonev opened this issue Nov 25, 2022 · 7 comments
Closed

Liquibase Yaml + SQL isn't working in native image #125

nkonev opened this issue Nov 25, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@nkonev
Copy link
Contributor

nkonev commented Nov 25, 2022

Reproducer

git clone [email protected]:nkonev/web-jdbc-flyway-native.git # Don't take on account repository name, it's Liquibase
cd web-jdbc-flyway-native
git checkout liquibase
./gradlew clean bootBuildImage
docker-compose up -d
docker run --network=host --rm -p 8080:8080 docker.io/library/web-jdbc-native:0.0.1-SNAPSHOT
2022-11-25T11:38:17.811Z  WARN 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appRunner': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'subjectRepository': Unsatisfied dependency expressed through method 'setMappingContext' parameter 0: Error creating bean with name 'jdbcMappingContext': Unsatisfied dependency expressed through method 'jdbcMappingContext' parameter 1: Error creating bean with name 'jdbcDialect': Unsatisfied dependency expressed through method 'jdbcDialect' parameter 0: Error creating bean with name 'liquibase': Runtime reflection is not supported for public void liquibase.change.core.SQLFileChange.setPath(java.lang.String)
2022-11-25T11:38:17.811Z  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : web_jdbc_ds - Shutdown initiated...
2022-11-25T11:38:17.811Z  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : web_jdbc_ds - Shutdown completed.
2022-11-25T11:38:17.812Z  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2022-11-25T11:38:17.813Z ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appRunner': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'subjectRepository': Unsatisfied dependency expressed through method 'setMappingContext' parameter 0: Error creating bean with name 'jdbcMappingContext': Unsatisfied dependency expressed through method 'jdbcMappingContext' parameter 1: Error creating bean with name 'jdbcDialect': Unsatisfied dependency expressed through method 'jdbcDialect' parameter 0: Error creating bean with name 'liquibase': Runtime reflection is not supported for public void liquibase.change.core.SQLFileChange.setPath(java.lang.String)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:351) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:271) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:206) ~[na:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:961) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:915) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:3.0.0]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:3.0.0]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:3.0.0]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:3.0.0]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:3.0.0]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:3.0.0]
        at name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt.main(WebJdbcNativeApplication.kt:72) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'subjectRepository': Unsatisfied dependency expressed through method 'setMappingContext' parameter 0: Error creating bean with name 'jdbcMappingContext': Unsatisfied dependency expressed through method 'jdbcMappingContext' parameter 1: Error creating bean with name 'jdbcDialect': Unsatisfied dependency expressed through method 'jdbcDialect' parameter 0: Error creating bean with name 'liquibase': Runtime reflection is not supported for public void liquibase.change.core.SQLFileChange.setPath(java.lang.String)
        at org.springframework.beans.factory.aot.AutowiredMethodArgumentsResolver.resolveArguments(AutowiredMethodArgumentsResolver.java:197) ~[na:na]
        at org.springframework.beans.factory.aot.AutowiredMethodArgumentsResolver.resolve(AutowiredMethodArgumentsResolver.java:145) ~[na:na]
        at org.springframework.beans.factory.aot.AutowiredMethodArgumentsResolver.resolve(AutowiredMethodArgumentsResolver.java:131) ~[na:na]
        at org.springframework.data.jdbc.repository.support.JdbcRepositoryFactoryBean__Autowiring.apply(JdbcRepositoryFactoryBean__Autowiring.java:20) ~[na:na]
        at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:82) ~[na:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1405) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1325) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:334) ~[na:na]
        ... 21 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdbcMappingContext': Unsatisfied dependency expressed through method 'jdbcMappingContext' parameter 1: Error creating bean with name 'jdbcDialect': Unsatisfied dependency expressed through method 'jdbcDialect' parameter 0: Error creating bean with name 'liquibase': Runtime reflection is not supported for public void liquibase.change.core.SQLFileChange.setPath(java.lang.String)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:351) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:271) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:206) ~[na:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1405) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1325) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.aot.AutowiredMethodArgumentsResolver.resolveArguments(AutowiredMethodArgumentsResolver.java:189) ~[na:na]
        ... 38 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdbcDialect': Unsatisfied dependency expressed through method 'jdbcDialect' parameter 0: Error creating bean with name 'liquibase': Runtime reflection is not supported for public void liquibase.change.core.SQLFileChange.setPath(java.lang.String)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:351) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:271) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:206) ~[na:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:225) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1298) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1259) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:483) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:338) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:331) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1148) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration.jdbcCustomConversions(AbstractJdbcConfiguration.java:154) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:3.0.0]
        at org.springframework.boot.autoconfigure.data.jdbc.JdbcRepositoriesAutoConfiguration$SpringBootJdbcConfiguration.jdbcCustomConversions(JdbcRepositoriesAutoConfiguration.java:121) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:3.0.0]
        at org.springframework.boot.autoconfigure.data.jdbc.JdbcRepositoriesAutoConfiguration__BeanDefinitions$SpringBootJdbcConfiguration__BeanDefinitions.lambda$getJdbcCustomConversionsInstanceSupplier$4(JdbcRepositoriesAutoConfiguration__BeanDefinitions.java:124) ~[na:na]
        at org.springframework.util.function.ThrowingFunction.apply(ThrowingFunction.java:63) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.util.function.ThrowingFunction.apply(ThrowingFunction.java:51) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$withGenerator$0(BeanInstanceSupplier.java:173) ~[na:na]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:68) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:54) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$get$2(BeanInstanceSupplier.java:208) ~[na:na]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:59) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:47) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.invokeBeanSupplier(BeanInstanceSupplier.java:220) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:208) ~[na:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1405) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1325) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:334) ~[na:na]
        ... 53 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase': Runtime reflection is not supported for public void liquibase.change.core.SQLFileChange.setPath(java.lang.String)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:313) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1405) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1325) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:334) ~[na:na]
        ... 96 common frames omitted
Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Runtime reflection is not supported for public void liquibase.change.core.SQLFileChange.setPath(java.lang.String)
        at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89) ~[na:na]
        at [email protected]/java.lang.reflect.Method.acquireMethodAccessor(Method.java:71) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at [email protected]/java.lang.reflect.Method.invoke(Method.java:566) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.change.ChangeParameterMetaData.setValue(ChangeParameterMetaData.java:350) ~[na:na]
        at liquibase.change.AbstractChange.load(AbstractChange.java:712) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.changelog.ChangeSet.toChange(ChangeSet.java:535) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.changelog.ChangeSet.handleChildNode(ChangeSet.java:460) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.changelog.ChangeSet.handleChildNode(ChangeSet.java:456) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.changelog.ChangeSet.load(ChangeSet.java:384) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.changelog.DatabaseChangeLog.createChangeSet(DatabaseChangeLog.java:761) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:395) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:364) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:84) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:408) ~[na:na]
        at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:393) ~[na:na]
        at liquibase.Liquibase.lambda$update$1(Liquibase.java:249) ~[na:na]
        at liquibase.Scope.lambda$child$0(Scope.java:180) ~[na:na]
        at liquibase.Scope.child(Scope.java:189) ~[na:na]
        at liquibase.Scope.child(Scope.java:179) ~[na:na]
        at liquibase.Scope.child(Scope.java:158) ~[na:na]
        at liquibase.Liquibase.runInScope(Liquibase.java:2447) ~[na:na]
        at liquibase.Liquibase.update(Liquibase.java:236) ~[na:na]
        at liquibase.Liquibase.update(Liquibase.java:221) ~[na:na]
        at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:328) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:283) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747) ~[name.nkonev.example.webjdbcnative.WebJdbcNativeApplicationKt:6.0.2]
        ... 108 common frames omitted

Originally reported here spring-projects/spring-boot#33358

@nkonev nkonev added the enhancement New feature or request label Nov 25, 2022
@wilkinsona
Copy link
Contributor

IMO, this is a bug. A reflection hint for liquibase.change.core.SQLFileChange.setPath is missing. It's only required when using sqlFile:

-  changeSet:
        id:  sqlFile-example
        author:  liquibase-docs
        changes:
        -  sqlFile:
        	dbms:  '!h2,  oracle,  mysql'
        	endDelimiter:  \nGO
        	splitStatements:  true
        	path:  my/path/file.sql
        	stripComments:  true

Hints for other methods on SQLFileChange may also be missing. The sample that accompanied the original report only set the path:

databaseChangeLog:
  - changeSet:
      id: 1
      author: nkonev

      changes:
        - sqlFile:
            path: /db/changelog/1648380286__init.sql

@wilkinsona
Copy link
Contributor

It looks to me like #118 will fix this as it allows reflective invocation of all methods on SQLFileChange.

@linghengqian
Copy link
Contributor

@nkonev Are you sure that the files under https://github.com/oracle/graalvm-reachability-metadata/tree/master/metadata%2Forg.liquibase%2Fliquibase-core%2F4.17.0 still cannot solve the current issue?

@nkonev
Copy link
Contributor Author

nkonev commented Jan 26, 2023

Not completely understood what exactly you asking for.
I am waiting for the next release which contains #118 that should solve this issue.

@linghengqian
Copy link
Contributor

linghengqian commented Jan 26, 2023

@nkonev

  • I mean, you can put the existing json file into main/resources/META-INF/native-image/liquibase-test-metadata/ of your project, ie https://github.com/nkonev/web-jdbc-flyway-native/tree/master/src%2Fmain%2Fresources and run the tests to verify.

  • The main reason for my inconvenient verification is that I have almost no experience packaging native images for Spring Boot, and it looks like you didn't write unit tests for verification for this project.

@nkonev
Copy link
Contributor Author

nkonev commented Jan 26, 2023

@linghengqian it works

@linghengqian
Copy link
Contributor

linghengqian commented Jan 26, 2023

@linghengqian it works

  • From this point of view, it seems that there is no need to continue to open this issue, because I don't know when it will release 0.2.6.

  • Now the CI of the current project is broken, at Fix Not Supported Java Version Bug #203 is being fixed, I assume ideally release graalvm reachability metadata once a week.

@nkonev nkonev closed this as completed Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants