Andy
Andy

Reputation: 6329

Spring Eureka Dashboard not loading

I am trying to start a Eureka server with basic configuration, but the dashboard will not load. Instead, below XML is being returned. enter image description here

Please find the below code.

In application.yml file

eureka:
  environment: qa
  client:
    fetch-registry: false
    register-with-eureka: false
  dashboard:
    enabled: true

spring:
  application:
    name: eureka-server    

server:
  port: 8761

Main class:

@SpringBootApplication
@EnableEurekaServer
public class MygynecologistEurekaServerApplication {

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

pom.xml

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.4.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <spring-cloud.version>Dalston.RELEASE</spring-cloud.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-eureka-server</artifactId>
    </dependency>

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

A similar question was asked here, but it was resolved. Thanks for reading.

UPDATE: with the same code I was able to load the eureka dashboard in a windows machine(windows 8.1) . But it doesn't work in my macbook pro. Should we have to add any extra settings for mac?

Upvotes: 1

Views: 3750

Answers (2)

W.K.S
W.K.S

Reputation: 10095

I had the same problem. To fix it I had to do the following:

  1. Delete the resources/static and resources/templates folders.
  2. Clean the project by deleting the build (or out) directory.

Once you restart the eureka service, you should be able to see the Eureka dashboard.

Upvotes: 4

Andy
Andy

Reputation: 6329

I finally found a solution. The issue has got something to do with the versions I used. I made the following changes to fix it

  1. Updated the spring-boot-starter-parent version to 2.0.2.RELEASE
  2. Updated the spring-cloud-dependencies version to Finchley.RC1
  3. Changed the Artifact ID to spring-cloud-starter-netflix-eureka-server

Upvotes: 2

Related Questions