Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Add spring-cloud-openfeign support #766

Closed
nightlonely7 opened this issue May 3, 2021 · 21 comments
Closed

Add spring-cloud-openfeign support #766

nightlonely7 opened this issue May 3, 2021 · 21 comments
Labels
for: external-project For an external project and not something we can fix status: declined A suggestion or change that we don't feel we should currently apply type: compatibility Native image compatibility issue

Comments

@nightlonely7
Copy link

nightlonely7 commented May 3, 2021

spring-boot: 2.4.5
spring-native: 0.9.2
when I ran my app's image after gradle bootBuildImage I got the following errors: ( no errors before spring-native integrated)

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.cloud.openfeign.loadbalancer.FeignLoadBalancerAutoConfiguration]; nested exception is java.lang.IllegalArgumentException: Coul d not find class [org.springframework.cloud.openfeign.HttpClient5DisabledConditions] at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:610) ~[na:na] at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:311) ~[na:na] at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) ~[na:na] at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:600) ~[na:na] at org.springframework.context.annotation.ConfigurationClassParser.access$800(ConfigurationClassParser.java:111) ~[na:na] at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.lambda$processGroupImports$1(ConfigurationClassParser.java:812) ~[na:na] at java.util.ArrayList.forEach(ArrayList.java:1541) ~[au.com.nab.smartchoice.SmartChoiceApplication:na] at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:809) ~[na:na] at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:780) ~[na:na] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:193) ~[na:na] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) ~[au.com.nab.smartchoice.SmartChoiceApplication:5.3.6] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) ~[au.com.nab.smartchoice.SmartChoiceApplication:5.3.6] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) ~[na:na] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) ~[na:na] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) ~[na:na] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[na:na] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[na:na] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:782) ~[au.com.nab.smartchoice.SmartChoiceApplication:2.4.5] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:774) ~[au.com.nab.smartchoice.SmartChoiceApplication:2.4.5] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) ~[au.com.nab.smartchoice.SmartChoiceApplication:2.4.5] at org.springframework.boot.SpringApplication.run(SpringApplication.java:339) ~[au.com.nab.smartchoice.SmartChoiceApplication:2.4.5] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1340) ~[au.com.nab.smartchoice.SmartChoiceApplication:2.4.5] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329) ~[au.com.nab.smartchoice.SmartChoiceApplication:2.4.5] at au.com.nab.smartchoice.SmartChoiceApplication.main(SmartChoiceApplication.java:12) ~[au.com.nab.smartchoice.SmartChoiceApplication:na] Caused by: java.lang.IllegalArgumentException: Could not find class [org.springframework.cloud.openfeign.HttpClient5DisabledConditions] at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:334) ~[na:na] at org.springframework.context.annotation.ConditionEvaluator.getCondition(ConditionEvaluator.java:124) ~[na:na] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:96) ~[na:na] at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:226) ~[na:na] at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:600) ~[na:na] ... 23 common frames omitted Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.openfeign.HttpClient5DisabledConditions at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:60) ~[na:na] at java.lang.Class.forName(DynamicHub.java:1260) ~[na:na] at org.springframework.util.ClassUtils.forName(ClassUtils.java:284) ~[na:na] at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:324) ~[na:na] ... 27 common frames omitted

Hope it will be fixed soon :)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 3, 2021
@sdeleuze sdeleuze changed the title openfeign not supported yet Add spring-cloud-openfeign support May 5, 2021
@sdeleuze sdeleuze added type: compatibility Native image compatibility issue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 5, 2021
@sdeleuze sdeleuze added this to the Backlog milestone May 5, 2021
@sdeleuze
Copy link
Contributor

sdeleuze commented May 5, 2021

cc @spencergibb @OlgaMaciaszek

@lgklein
Copy link

lgklein commented Aug 23, 2021

Hello, any news about this or a way to make feignclients work in spring native?

Edit: It would be great if this issue were incorporated into 0.12.0!

@rab2215
Copy link

rab2215 commented Sep 14, 2021

Same issue here, hoping for an ETA?

@stefanof95
Copy link

I have the same issue with spring-cloud-starter-openfeign.

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appRunner' defined in class path resource [com/example/restservice/AppRunner.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.restservice.config.FeignConfiguration$ArangoServiceClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[na:na]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[na:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1354) ~[na:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) ~[na:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) ~[na:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[na:na]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[na:na]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[na:na]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[na:na]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[na:na]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[na:na]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[na:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[na:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
at com.example.restservice.RestServiceApplication.main(RestServiceApplication.java:14) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.restservice.config.FeignConfiguration$ArangoServiceClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1790) ~[na:na]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1346) ~[na:na]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[na:na]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[na:na]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[na:na]
... 18 common frames omitted

Is there any workaround, please?

@lgklein
Copy link

lgklein commented Sep 22, 2021

I have the same issue with spring-cloud-starter-openfeign.

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appRunner' defined in class path resource [com/example/restservice/AppRunner.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.restservice.config.FeignConfiguration$ArangoServiceClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[na:na]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[na:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1354) ~[na:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) ~[na:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) ~[na:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[na:na]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[na:na]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[na:na]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[na:na]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[na:na]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[na:na]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[na:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[na:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
at com.example.restservice.RestServiceApplication.main(RestServiceApplication.java:14) ~[rest-service-complete.exe:0.0.1-SNAPSHOT]
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.restservice.config.FeignConfiguration$ArangoServiceClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1790) ~[na:na]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1346) ~[na:na]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[na:na]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[na:na]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[na:na]
... 18 common frames omitted

Is there any workaround, please?

I was able to make it work here with minimal changes (and lots of hints and jdkproxys), your specific error is because @EnableFeignClients when it receives a package tries to reflect at runtime... If you declare clients directly in the annotation:
@EnableFeignClients(clients=`{Client1.class}) it will work.

@stefanof95
Copy link

Thank you for your help. It works with the following HInts:

@configuration
@NativeHint(trigger = FeignConfiguration.class,
types = {
@typehint(types = WebServiceClient.class),
@typehint(types = FeignClient.class),
@typehint(typeNames = "org.springframework.cloud.openfeign.FeignClientSpecification"),
@typehint(types = FeignClientsConfiguration.class)
},
jdkProxies = {
@JdkProxyHint(types = WebServiceClient.class),
@JdkProxyHint(types = {PathVariable.class, SynthesizedAnnotation.class}),
@JdkProxyHint(types = {RequestHeader.class, SynthesizedAnnotation.class}),
@JdkProxyHint(types = {RequestBody.class, SynthesizedAnnotation.class}),
@JdkProxyHint(types = {RequestParam.class, SynthesizedAnnotation.class})
}
)
@EnableFeignClients(clients = {WebServiceClient.class})
public class FeignConfiguration {
}

@martintw
Copy link

martintw commented Dec 16, 2021

^ this worked on Spring Native 0.10.5 and Spring Boot 2.5.x

Sadly this is broken again on Spring Native 0.11.0 and Spring Boot 2.6.1. The above workaround no longer works.

Has anyone managed to find an alternative workaround?

@sdeleuze
Copy link
Contributor

@OlgaMaciaszek Could you please confirm spring-cloud-openfeign requires child application context support?

@spencergibb
Copy link
Contributor

it does require child application contexts

@sdeleuze
Copy link
Contributor

Thanks @spencergibb, so I confirm this won't be supported in 0.11.x, but we are well aware of that limitation in our support plan to have this proper supported in 2022. If you really need it, please use Spring Native 0.10.x. Thanks for your understanding.

@lgklein
Copy link

lgklein commented Dec 17, 2021

Thanks @spencergibb, so I confirm this won't be supported in 0.11.x, but we are well aware of that limitation in our support plan to have this proper supported in 2022. If you really need it, please use Spring Native 0.10.x. Thanks for your understanding.

Can you please give me a light on why application context stop working?

Asking why depending on what caused it I can try to make it work for my specific case and use 0.11 (which has some important fixes and improvements for me) or keep 0.10.x longer....

@sdeleuze
Copy link
Contributor

sdeleuze commented Jan 3, 2022

It is due to child application context not supported with 0.11 anymore, we will likely work on a proper solution based on Spring Boot 3.

@CynanX
Copy link

CynanX commented Jan 12, 2022

I have an application which uses child application contexts and noticed that since upgrading to SB 2.6.x and SN 0.11.x that the application will no longer run. Thank you for the update guys. Will keep using 0.10.x for now but looking forward to support being reintroduced soon.

@sdeleuze
Copy link
Contributor

sdeleuze commented Feb 1, 2022

FYI I released 0.10.6 for people still requiring to use 0.10.x.

@wwadge
Copy link

wwadge commented Feb 16, 2022

FYI 0.10.6 won't work with Java 17

@lgklein
Copy link

lgklein commented Apr 14, 2022

@spencergibb there is any workaround for this on 0.11+? We need to update the version here, but we still need the openfeign to work....

@OlgaMaciaszek
Copy link
Contributor

@lgklein , unfortunately not. Support is being planned with Spring Cloud 2022.x. Appropriate changes in upstream projects, such as Spring 6, have to be introduced first in order for us to be able to provide this functionality.

@mbogner
Copy link

mbogner commented Nov 1, 2022

I think I ran into the same issue. I am facing problems with Feign and running the native application. Compilation works. Giving EnableFeignClients the clients fails with a NPE during compilation already. Running the app fails with given exception. Similar to what I read above.

Exact versions:

  • Spring Boot 3.0.0-RC1
  • GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08)
  • Spring Cloud 2022.0.0-RC1

I was hoping that it already works in the 2022 RC.

Looks like I have to abandon feign in favor of another client lib.

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'senderApiController': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'senderApiDelegateImpl': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'blaService': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'stationsApi': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:365) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:281) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:209) ~[na:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:931) ~[app:6.0.0-RC2]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:916) ~[app:6.0.0-RC2]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[app:6.0.0-RC2]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[app:3.0.0-RC1]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[app:3.0.0-RC1]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[app:3.0.0-RC1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[app:3.0.0-RC1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[app:3.0.0-RC1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[app:3.0.0-RC1]
        at dev.mbo.dat0r.Dat0rKt.main(Dat0r.kt:23) ~[app:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'senderApiDelegateImpl': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'blaService': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'stationsApi': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:365) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:281) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:209) ~[na:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1375) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1295) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:348) ~[na:na]
        ... 21 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'blaService': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'stationsApi': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:365) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:281) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:209) ~[na:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1375) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1295) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:348) ~[na:na]
        ... 36 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stationsApi': Instantiation of supplied bean failed
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1236) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1375) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1295) ~[app:6.0.0-RC2]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:348) ~[na:na]
        ... 51 common frames omitted
Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface [dev.mbo.dat0r.client.bla.api.StationsApi]](url) not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89) ~[na:na]
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:171) ~[na:na]
        at java.base@17.0.5/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47) ~[app:na]
        at java.base@17.0.5/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037) ~[app:na]
        at feign.ReflectiveFeign.newInstance(ReflectiveFeign.java:65) ~[na:na]
        at feign.Feign$Builder.target(Feign.java:205) ~[app:na]
        at feign.Feign$Builder.target(Feign.java:201) ~[app:na]
        at dev.mbo.dat0r.client.bla.api.BlaStationsApi.stationsApi(BlaStationsApi.kt:17) ~[app:na]
        at dev.mbo.dat0r.client.bla.api.BlaStationsApi$$SpringCGLIB$$0.CGLIB$stationsApi$0(<generated>) ~[app:na]
        at dev.mbo.dat0r.client.bla.api.BlaStationsApi$$SpringCGLIB$$2.invoke(<generated>) ~[app:na]
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:257) ~[app:6.0.0-RC2]
        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[na:na]
        at dev.mbo.dat0r.client.bla.api.BlaStationsApi$$SpringCGLIB$$0.stationsApi(<generated>) ~[app:na]
        at dev.mbo.dat0r.client.bla.api.BlaStationsApi__BeanDefinitions.lambda$getStationsApiInstanceSupplier$1(BlaStationsApi__BeanDefinitions.java:40) ~[na:na]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:68) ~[app:6.0.0-RC2]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:54) ~[app: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) ~[app:6.0.0-RC2]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:47) ~[app: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) ~[app:6.0.0-RC2]
        ... 63 common frames omitted

@lgklein
Copy link

lgklein commented Nov 1, 2022

@mbogner you can track the implementation on this one: spring-cloud/spring-cloud-openfeign#742

@mbogner
Copy link

mbogner commented Nov 1, 2022

@lgklein thank you. subscribed to it

@OlgaMaciaszek
Copy link
Contributor

Hello @nightlonely7 . We are working on OpenFeign AOT and native image support for Spring Cloud 2022.x. Support withing the experimental Spring Native project will not be added.

@sdeleuze sdeleuze removed this from the Backlog milestone Nov 3, 2022
@sdeleuze sdeleuze added status: declined A suggestion or change that we don't feel we should currently apply for: external-project For an external project and not something we can fix labels Nov 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
for: external-project For an external project and not something we can fix status: declined A suggestion or change that we don't feel we should currently apply type: compatibility Native image compatibility issue
Development

No branches or pull requests