Spring boot with endpoints creates two Tomcat containers

大兔子大兔子 提交于 2019-12-25 01:44:04

问题


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>

management properties

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

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?


回答1:


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



来源:https://stackoverflow.com/questions/27575595/spring-boot-with-endpoints-creates-two-tomcat-containers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!