0
votes

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
Is your goal to expose the management endpoints over HTTP in an app that otherwise doesn't use HTTP? Alternatively, it should be possible to have both ports configured to the same value. You said that "nothing works". Can you expand on that a bit? What failure do you see? How did you determine that things aren't working? - Andy Wilkinson
What does the application.properties looks like did specify what port you want spring boot embedded server to use? - ndrone

1 Answers

1
votes

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