Spring boot with endpoints creates two Tomcat containers

2.5k Views Asked by At

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

There are 1 best solutions below

8
On

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