question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GraalVM native build NoSuchMethodException: liquibase.configuration.LiquibaseConfiguration.<init>() (3.0.0-RC1)

See original GitHub issue

Bug report

New Spring Boot 3.0.0-RC1 application with Liquibase + GraalVM native build results in the following error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase': Instantiation of supplied bean failed
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1236) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:313) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[inventory:6.0.0-RC2]
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1131) ~[inventory:6.0.0-RC2]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:906) ~[inventory:6.0.0-RC2]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[inventory:6.0.0-RC2]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[inventory:3.0.0-RC1]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[inventory:3.0.0-RC1]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[inventory:3.0.0-RC1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[inventory:3.0.0-RC1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[inventory:3.0.0-RC1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[inventory:3.0.0-RC1]
        at inventory.InventoryApplication.main(InventoryApplication.java:13) ~[inventory:na]
        at java.base@17.0.5/java.lang.reflect.Method.invoke(Method.java:568) ~[inventory:na]
        at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[na:na]
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) ~[inventory:na]
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203) ~[na:na]
Caused by: liquibase.exception.UnexpectedLiquibaseException: java.lang.NoSuchMethodException: liquibase.configuration.LiquibaseConfiguration.<init>()
        at liquibase.Scope.getSingleton(Scope.java:329) ~[na:na]
        at liquibase.Scope.getCurrentScope(Scope.java:83) ~[na:na]
        at liquibase.integration.spring.SpringLiquibase.<init>(SpringLiquibase.java:56) ~[inventory:na]
        at org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration.createSpringLiquibase(LiquibaseAutoConfiguration.java:114) ~[inventory:na]
        at org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration.liquibase(LiquibaseAutoConfiguration.java:90) ~[inventory:na]
        at org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration__BeanDefinitions$LiquibaseConfiguration__BeanDefinitions.lambda$getLiquibaseInstanceSupplier$1(LiquibaseAutoConfiguration__BeanDefinitions.java:71) ~[na:na]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:68) ~[inventory:6.0.0-RC2]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:54) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$get$2(BeanInstanceSupplier.java:212) ~[na:na]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:59) ~[inventory:6.0.0-RC2]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:47) ~[inventory:6.0.0-RC2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.invokeBeanSupplier(BeanInstanceSupplier.java:224) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:211) ~[na:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[inventory:6.0.0-RC2]
        ... 24 common frames omitted
Caused by: java.lang.NoSuchMethodException: liquibase.configuration.LiquibaseConfiguration.<init>()
        at java.base@17.0.5/java.lang.Class.getConstructor0(DynamicHub.java:3585) ~[inventory:na]
        at java.base@17.0.5/java.lang.Class.getDeclaredConstructor(DynamicHub.java:2754) ~[inventory:na]
        at liquibase.Scope.getSingleton(Scope.java:324) ~[na:na]
        ... 37 common frames omitted

How to reproduce:

  • Go to https://start.spring.io/, choose version 3.0.0 (RC1), Liquibase, JPA and H2 and create the app
  • Add a simple Liquibase changelog
  • Run mvn package and then mvn -Pnative -DskipTests native:compile
  • Run the resulting application and the error will show

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
christophstroblcommented, Nov 9, 2022

@wilkinsona thanks for the heads up. I’ve opened oracle/graalvm-reachability-metadata#106 to cover both AttributeBinder and AnnotationValueGeneration types which are instantiated reflectively via the PropertyBinder.

1reaction
wilkinsonacommented, Oct 31, 2022

Not yet. We intend to update https://github.com/spring-projects/spring-boot/wiki/Known-GraalVM-Native-Image-Limitations but haven’t yet had time to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support for GraalVM native images · Issue #1552 · liquibase ...
GraalVM native build NoSuchMethodException : liquibase.configuration.LiquibaseConfiguration.<init>() (3.0.0-RC1) spring-projects/spring-boot# ...
Read more >
java - springboot native-image NoSuchMethodException
I'm tryying to use GraalVM native-image to compile a spring-boot project to build an .exe file. ... warning occured in building : The...
Read more >
Native Support in Spring Boot 3.0.0-M5
Once you've done that, one way to build a native image is by using the Native Build Tools plugin and a local GraalVM...
Read more >
3 Configuration - Micronaut Liquibase
Micronaut Liquibase is compatible with GraalVM so it is possible to create native images and run the migrations during application startup. Everything is ......
Read more >
Fix GraalVM Native Image Build Issues - Simply-How.com
1. Introduction 2. Getting started 3. Build-time errors
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found