title: Multiple Spring Boot Applications
body: <p>I am trying to build a test setup containing two Sprin Boot Applications. 
  Both of the Apps have a seperate class. </p>
  
  <p>Both Apps look something like this: (but are different, seperated classes)</p>
  
  <pre><code>import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.web.bind.annotation.*;
  
  @RestController
  @EnableAutoConfiguration
  public class MySpringBootApplet {
  
      @RequestMapping("/")
      public String home() {
          System.out.println("home() called ..");
  
          try {
              Thread.sleep(1000);
          } catch (InterruptedException ex) {
              Thread.currentThread().interrupt();
          }
  
          System.out.println("waited ..");
  
          return "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;body&gt;&lt;h1&gt;Test&lt;/h1&gt;&lt;p&gt;Hello world!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;";
      }
  </code></pre>
  
  <p>Both are started with </p>
  
  <pre><code>SpringApplication app = new SpringApplication(MySpringBootApplet.class);
  app.run();
  </code></pre>
  
  <p>When the second app is started, I get the error:</p>
  
  <blockquote>
    <p>org.springframework.jmx.export.UnableToRegisterMBeanException: Unable
    to register MBean
    [org.springframework.boot.actuate.endpoint.jmx.DataEndpointMBean@6a48a7f3]
    with key 'requestMappingEndpoint'; nested exception is
    javax.management.InstanceAlreadyExistsException:
    org.springframework.boot:type=Endpoint,name=requestMappingEndpoint</p>
  </blockquote>
  
  <p>I can imagine that this is because both applications try to register with the same interface. But how do I separate this? </p>
  
  <p>Thanks for your help</p>