Spring Boot actuator with multiple web applications in a tomcat container throws javax.management.InstanceAlreadyExistsException exception

By default all endpoints are registered under the domain org.springboot and with a default name. These can be overridden by setting endpoints.jmx.* properties. See here .

You might want to change either the domain per application or set the endpoints.jmx.unique-names to true.


Disable JMX in application.properties by adding following property

spring.jmx.enabled = false

Unique names did not work for me. I had to also add a default domain.

Here's my yml code

spring:
  jmx:
    default-domain: agentservice

endpoints: 
  jmx:
    domain: agentservice
    unique-names: true