【问题标题】:Unable to view Eureka Dashboard无法查看 Eureka 仪表板
【发布时间】:2020-05-21 15:49:47
【问题描述】:

我有一个简单的 Spring Boot 应用程序,我正在尝试在其上运行 Eureka 服务器。

这是我的主要应用程序文件。

@SpringBootApplication
@EnableEurekaServer
public class NetflixEurekaNamingServerApplication {
    public static void main(String[] args) {
       SpringApplication.run(NetflixEurekaNamingServerApplication.class, args);
    }
}

这是我的应用程序属性文件

spring.application.name=netflix-eureka-naming-server
server.port=8761
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false

使用的依赖项。

spring boot version : 2.2.4.RELEASE
spring cloud version : Hoxton.SR1
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server'

但是当我运行应用程序并访问 localhost:8761 时,我收到一个显示 404 NOT FOUND 的 Whitelabel 页面错误。

当我根据这篇帖子更改配置时unable to render eureka dashboard

然后它开始向我显示一个 XML 页面而不是仪表板。

有人可以帮我吗?

【问题讨论】:

  • 日志中的内容是什么?
  • 如果您的意思是应用程序日志,那么应用程序成功启动,没有任何错误我可以看到“已启动 eureka 服务器”和“应用程序已启动”日志

标签: java spring-boot netflix-eureka


【解决方案1】:

我遇到了问题。

只需在 application.properties 文件中添加这两个属性即可。

spring.freemarker.template-loader-path= classpath:/templates/
spring.freemarker.prefer-file-system-access= false

我正在使用 spring boot 版本 2.2.4.RELEASE 和 springCloudVersion Hoxton.SR1

【讨论】:

    【解决方案2】:

    Eureka Dashboard 应该在 http://localhost:8761/eureka/ 下可用

    【讨论】:

    • 我已经检查了那个 URL,但它显示 not found 也像 page not found 错误。
    猜你喜欢
    • 1970-01-01
    • 2014-06-24
    • 2021-04-10
    • 1970-01-01
    • 2017-01-30
    • 1970-01-01
    • 2018-10-02
    • 1970-01-01
    • 2014-10-05
    相关资源
    最近更新 更多