Add spring-cloud-openfeign support #766
Comments
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! |
Same issue here, hoping for an ETA? |
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: {} 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: |
Thank you for your help. It works with the following HInts: @configuration |
^ 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? |
@OlgaMaciaszek Could you please confirm |
it does require child application contexts |
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.... |
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. |
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. |
FYI I released 0.10.6 for people still requiring to use 0.10.x. |
FYI 0.10.6 won't work with Java 17 |
@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.... |
@lgklein , unfortunately not. Support is being planned with Spring Cloud |
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:
I was hoping that it already works in the 2022 RC. Looks like I have to abandon feign in favor of another client lib.
|
@mbogner you can track the implementation on this one: spring-cloud/spring-cloud-openfeign#742 |
@lgklein thank you. subscribed to it |
Hello @nightlonely7 . We are working on OpenFeign AOT and native image support for Spring Cloud |
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 :)
The text was updated successfully, but these errors were encountered: