Ragavan
Ragavan

Reputation: 101

Eureka Server Error EurekaClientAutoConfiguration

Error creating bean with name 'org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.core.env.ConfigurableEnvironment' available: expected at least 1 bean which qualifies as autowire candidate.

Eureka error screenshot

build.gradle

buildscript {
    ext {
        springBootVersion = '2.0.2.RELEASE'
        springCloudVersion = 'Finchley.RC2'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.ragavan'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/milestone" }
}

configurations {
    providedRuntime
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-actuator')
    compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-server')
    runtime('org.springframework.boot:spring-boot-devtools')
    providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }
}

Application

package com.ragavan.discovery;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

@SpringBootApplication
@EnableEurekaServer
public class DiscoveryServerApplication {

  public static void main(String[] args) {
    SpringApplication.run(DiscoveryServerApplication.class, args);
  }
}

Upvotes: 1

Views: 2394

Answers (2)

BL Dobwal
BL Dobwal

Reputation: 1

Same issue was coming with 2.1.4.RELEASE also. but it resolved with 2.1.5.RELEASE.

Upvotes: 0

Shashank Bodkhe
Shashank Bodkhe

Reputation: 1012

I also faced the same issue : "No qualifying bean of type'org.springframework.core.env.ConfigurableEnvironment'"

I have used STS + maven in a spring boot project so updating the project with "Force update with snapshot release" will resolve the issue.

update dependencies

Also check if the port is not already in use

In application.properties

spring.application.name=server
server.port=8761

The server will start on port as shown below:

Server started screenshot

Upvotes: 1

Related Questions