Dears, I have created below spring cloud Netflix Eureka projects:

Eureka Server Eureka Client - provide some rest services Feign Client - Wants to access rest service through service discovery.

I am able to run Eureka Server, register Eureka Client But in my feign client I am getting below error:


APPLICATION FAILED TO START


Description:

Field greetingClient in com.example.mySpringBoot.FeignClientController required a bean of type 'com.example.mySpringBoot.GreetingClient' that could not be found.

Action:

Consider defining a bean of type 'com.example.mySpringBoot.GreetingClient' in your configuration.

Below is my project on github can someone help me what is missing or wrong in my project:

https://github.com/abhishekkhard/Spring-cloud-Eureka-Netflix

Can someone check it and identify the issue.

Comment From: spencergibb

You need to use a compatible version. Please use spring-cloud-starter-openfeign without a version.

Comment From: abhishekkhard

Thanks for your input, I tried with removal of version and use "spring-cloud-starter-openfeign" removed other dependencies as well from pom of feign client project, but still facing same issue. Can you please recheck my project: https://github.com/abhishekkhard/Spring-cloud-Eureka-Netflix

Comment From: spencergibb

You can't have request mapping at the interface level

Comment From: abhishekkhard

Thanks for quick response. I tries without interface and restController level !RequestMapping, but still same issue.

commited the same to repository: https://github.com/abhishekkhard/Spring-cloud-Eureka-Netflix

Comment From: ppachoui

Wondering if you were able to get around to this problem - this is still an issue as of Boot 2.1.2

Comment From: dj1095

still the same issue in Spring Boot 2..1.3

Comment From: SzymonSikora

I had the same issue with feign interface. I solved the problem by adding base package to annotation EnableFeignClients

It does not work: package pl.demo.fooservice;

@EnableFeignClients @SpringBootApplication public class FooServiceApplication

It solved my problem package pl.demo.fooservice;

@EnableFeignClients("pl.demo.*") @SpringBootApplication public class FooServiceApplication