没有嵌入式Tomcat的Spring启动管理员

时间:2017-08-18 09:05:40

标签: tomcat spring-boot tcserver spring-boot-admin

我试图在独立的servlet容器(Pivotal tc Server)上部署spring-boot .war应用程序,并且遇到spring-boot管理页面问题。 当我使用spring-boot:run命令运行应用程序时,我有正确的启动spring-boot管理UI页面, 但是当我在tcServer上部署war时,在根路径/上我看到spring-boot管理页面里面没有任何应用程序: 我如何启用管理页面:

  @EnableAdminServer
    public class AppRunner extends SpringBootServletInitializer { ... }

在我设置的属性中:

server.port=9000

运行tcServer时我在日志中看到:

  

jvm 1 | [2017.08.18 12:42:04.180 AST] [警告]   [d.c.b.a.s.ApplicationRegistrator] [pool-3-thread-1] [失败   在spring-boot-admin中将应用程序注册为null   http://localhost:9000/api/applications):必须在何时设置serviceUrl   部署到servlet-container]

tcServer在8080默认端口上运行。 任何人都可以提供如何在外部服务器上的spring-boot管理界面中查看我的应用程序的建议吗?

1 个答案:

答案 0 :(得分:3)

最后我通过添加属性解决了这个问题:

spring.boot.admin.client.service-url=http://localhost:9000

application.properties配置。