Spring Eureka App 不显示仪表板

yaz*_*ara 4 java spring microservices netflix-eureka

有一个 Eureka Server 应用程序:

@EnableEurekaServer
@SpringBootApplication
public class RegistrationModulesServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(RegistrationModulesServiceApplication.class, args);
    }
}
Run Code Online (Sandbox Code Playgroud)

使用 appplicaton.yml 配置(默认):

eureka:
  instance:
    hostname: localhost
  client: 
    registerWithEureka: false
    fetchRegistry: false

server:
  port: 1111  
Run Code Online (Sandbox Code Playgroud)

在第一次运行时 - 我看到了带有状态的仪表板。就像在文档中一样: 在此处输入图片说明

然后 - 重启后我只能看到 xml 响应: 在此处输入图片说明

为什么?

日志中没有错误。

小智 8

我遇到了完全相同的问题,经过长时间的调查,只需:从 /src/main/resources 中删除文件夹“templates”和“static”


Far*_*ron 5

对我来说,问题是我有一个空文件夹,src/main/resources/templates。当该文件夹存在时,FreeMarkerView 无法看到 spring-cloud-netflix-eureka-server 中包含的嵌入模板。我不记得这个文件夹的来源,但我怀疑它在在线示例中。