Closed
Description
Hello!
When running the spring-native sample integration
in the sb-3.0.x
branch, the generated native image fails with this exception:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'printFormattedSecondsFlow': Instantiation of supplied bean failed
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1234) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1209) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1156) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:566) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:526) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:930) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:926) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:592) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66) ~[integration:3.0.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:729) ~[integration:3.0.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:428) ~[integration:3.0.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[integration:3.0.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[integration:3.0.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) ~[integration:3.0.0-SNAPSHOT]
at com.example.integration.IntegrationApplication.main(IntegrationApplication.java:53) ~[integration:0.0.1-SNAPSHOT]
Caused by: java.lang.ExceptionInInitializerError: null
at org.springframework.integration.dsl.BaseIntegrationFlowDefinition.transform(BaseIntegrationFlowDefinition.java:729) ~[integration:6.0.0-M3]
at org.springframework.integration.dsl.BaseIntegrationFlowDefinition.convert(BaseIntegrationFlowDefinition.java:705) ~[integration:6.0.0-M3]
at com.example.integration.IntegrationApplication.lambda$printFormattedSecondsFlow$4(IntegrationApplication.java:115) ~[integration:0.0.1-SNAPSHOT]
at org.springframework.integration.dsl.BaseIntegrationFlowDefinition.obtainInputChannelFromFlow(BaseIntegrationFlowDefinition.java:430) ~[integration:6.0.0-M3]
at org.springframework.integration.dsl.BaseIntegrationFlowDefinition.gateway(BaseIntegrationFlowDefinition.java:2171) ~[integration:6.0.0-M3]
at org.springframework.integration.dsl.BaseIntegrationFlowDefinition.gateway(BaseIntegrationFlowDefinition.java:2153) ~[integration:6.0.0-M3]
at com.example.integration.IntegrationApplication.printFormattedSecondsFlow(IntegrationApplication.java:115) ~[integration:0.0.1-SNAPSHOT]
at com.example.integration.IntegrationApplication__BeanDefinitions.lambda$getPrintFormattedSecondsFlowInstance$2(IntegrationApplication__BeanDefinitions.java:109) ~[na:na]
at org.springframework.util.function.ThrowingFunction.apply(ThrowingFunction.java:63) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.util.function.ThrowingFunction.apply(ThrowingFunction.java:51) ~[integration:6.0.0-SNAPSHOT]
at org.springframework.beans.factory.aot.AutowiredInstantiationArgumentsResolver.resolve(AutowiredInstantiationArgumentsResolver.java:156) ~[na:na]
at com.example.integration.IntegrationApplication__BeanDefinitions.getPrintFormattedSecondsFlowInstance(IntegrationApplication__BeanDefinitions.java:109) ~[na:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1223) ~[integration:6.0.0-SNAPSHOT]
... 18 common frames omitted
Caused by: java.lang.reflect.UndeclaredThrowableException: null
at org.springframework.util.ReflectionUtils.rethrowRuntimeException(ReflectionUtils.java:147) ~[na:na]
at org.springframework.integration.util.ClassUtils.<clinit>(ClassUtils.java:136) ~[na:na]
... 31 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.integration.handler.GenericHandler
at java.lang.Class.forName(DynamicHub.java:1121) ~[integration:na]
at org.springframework.util.ClassUtils.forName(ClassUtils.java:284) ~[na:na]
at org.springframework.integration.util.ClassUtils.<clinit>(ClassUtils.java:131) ~[na:na]
... 31 common frames omitted
It looks like that there are some runtime hints missing.