带有端点的春季启动将创建两个Tomcat容器 [英] Spring boot with endpoints creates two Tomcat containers

查看:111
本文介绍了带有端点的春季启动将创建两个Tomcat容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有以下conf的spring-boot jar:

I have a spring-boot jar with the the following conf:

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

      <dependency>
    <groupId>org.jolokia</groupId>
    <artifactId>jolokia-core</artifactId>
    <version>1.2.2</version>
  </dependency>
  <dependency>
    <groupId>org.jolokia</groupId>
    <artifactId>jolokia-client-javascript</artifactId>
    <version>1.2.2</version>
    <type>javascript</type>
  </dependency>

管理属性

info.app.name=MyApp
info.app.description="blah blah"
info.app.version=1.0.0
peg.sendInterval.millis=3600000
instance.name=Appster
jolokia.config.debug=true
endpoints.jolokia.enabled=true
endpoints.jolokia.path=jolokia
spring.jmx.enabled=true
endpoints.jmx.enabled=true
management.port=9001
management.address=<super-secret-ip>
security.user.name=admin
security.user.password=cracked

当我指定管理端口(9001)时,会看到一个单独的Tomcat实例.除了:9001之外,还有一个默认的Tomcat实例在8080/localhost上运行.如果将管理端口指定为8080,则没有任何效果.如何禁用运行在8080上的默认值?

When I specify management port (9001), I see a separate Tomcat instance for that. There is a default Tomcat instance that runs on 8080 / localhost in addition to :9001. If I specify the management port as 8080, nothing works. How can I disable the default one running on 8080?

推荐答案

设置server.port=-1将关闭主要应用程序Web终结点(根据

Setting server.port=-1 will switch off the main application web endpoints (per the docs here).

这篇关于带有端点的春季启动将创建两个Tomcat容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆