Trying to write Eureka Client With Spring Cloud Netflix v1.2.0.Release but facing the below mentioned issue. PFB code and configurations.
EurekaClient.java
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Configuration
@EnableAutoConfiguration
@EnableEurekaClient
@RestController
@ComponentScan(basePackages={"com.west.eas.netflix.config"})
public class EurekaClient {
@RequestMapping("/")
public String home() {
return "Hello World";
}
public static void main(String[] args) {
new SpringApplicationBuilder(EurekaClient.class).run(args);
}
}
application.yml
server:
port: 9000
spring:
application:
name: eas-eureka-client
eureka:
client:
healthcheck:
enabled: true
serviceUrl:
defaultZone: http://localhost:8761/eureka/
instance:
preferIpAddress: true
bootstrap.yml
spring:
application:
name: eu-client
cloud:
config:
uri: http://localhost:8888
encrypt:
failOnError: false
Client fails to start with following error
" Parameter 0 of method eurekaHealthIndicator in org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration$EurekaHealthIndicatorConfiguration required a bean of type 'com.netflix.discovery.EurekaClient' that could not be found."
the below screenshot will have more details on error stack
I even tried setting healthcheck enable to false in application.yml but it still wont work. Any Help would be appreciated.
Regards
spring.application.name
s in application and bootstrap? – spencergibb