Closed alexciornii closed 5 years ago
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
@ryanjbaxter Sorry, but maybe i didn't put correctly the question. I try to autowire in project with version of spring boot 2.0.6.RELEASE and spring-cloud Finchley.SR2 feign client from project with version of spring boot 1.4.2.RELEASE and spring-cloud Camden.SR3. It's not autowiring! Spring Boot magic can't find feign clients from version below. Is any idea how can resolve it?
P.S. If it still need a sample, i will prepare it.
Yes please provide a sample
in project in p.1 can't autowiring feign client from project in p.3. But in project p.2 that's working fine. I think there was a conflict between versions. Is any way to autowiring feign client from below versions?
Camden and Dalston are both end of life. Can you retry with Edgware?
@spencergibb No. The same problem.
Please update your samples to use the latest Edgware or Finchley releases.
@ryanjbaxter But i need it to be Camdem.
Camden is no longer supported
@spencergibb That's is understood. But if i have any project which is using Cadem.SR3 dependencies i can't use their feign clients in project with version above?
We are just not supporting Camden or Dalston any longer so if you can reproduce it with Edgeware than we can try and fix it there.
@ryanjbaxter Reproduced with Edgware.SR5 https://github.com/alexciornii/feignexample https://github.com/alexciornii/cloud-example
Unfortunately, you can't use an app with Finchley and import Edgware feign clients as the package of @FeignClient
changed with the major release. They will all need to be Edgware or Finchley.
Thanks.
Make sure your import is correct: import org.springframework.cloud.openfeign.FeignClient;
NOT: import org.springframework.cloud.netflix.feign.FeignClient;
The same problem. And you can use @EnableFeignClients(basePackages = "com.xxx.xxx"), for scan feign client
add(require = false)after your @Autowired, that can solve the problem ,But it didn't address the root cause
Same Problem when using Feign Client inside micronaut service. Does anyone has a workaround
I doubt feign client works in micronaut.
@spencergibb Do you know any reason why it cannot work in micronaut. According to my knowledge, micronaut uses Factory to create a instance of a external or dependency Bean(In in this eg CloudService). But DI wont allow OperatorClient to be injected since we are using new to create instance of CloudService. Let me know if my understanding is correct.
I have no idea how micronaut implements anything spring. FeignClients are created using non-trivial proxy creation. Besides the error message, it's going to be totally unrelated to this issue.
The same problem. And you can use @EnableFeignClients(basePackages = "com.xxx.xxx"), for scan feign client
Thank you, here working.
Make sure your import is correct: import org.springframework.cloud.openfeign.FeignClient;
NOT: import org.springframework.cloud.netflix.feign.FeignClient;
Thanks!
Hi, i resolve this problema using annotation @EnableFeignClients on applicationClass i follow this documentation : https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-feign.html
I try to autowire feign client into the service, but the error is Could not autowire. No beans of 'OperatorClient' type found. Spring cloud version Finchley.SR2 Spring boot version 2.0.6.RELEASE
That is pom:
That is main class:
FeignClient:
Controller:
Service:
Another Controller:
So, in CloudService the OperatorClient isn't autowiring.