title: WebSphere Liberty starts multiple singleton EJB instances
body: <p>I am developing an Enterprise application which is packaged in an ear. The ear consists of one Enterprise Bean application (in a jar), one JAX-RS application (in a war) and one web application (also in a war).</p>
  
  <p>The ear descriptor (application.xml) looks like this:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE application PUBLIC
      "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
      "http://java.sun.com/dtd/application_1_3.dtd"&gt;
  &lt;application&gt;
    &lt;display-name&gt;myapp-ear&lt;/display-name&gt;
    &lt;module&gt;
      &lt;web&gt;
        &lt;web-uri&gt;myapp-war-1.0.0-SNAPSHOT.war&lt;/web-uri&gt;
        &lt;context-root&gt;/&lt;/context-root&gt;
      &lt;/web&gt;
    &lt;/module&gt;
    &lt;module&gt;
      &lt;web&gt;
        &lt;web-uri&gt;myapp-rest-1.0.0-SNAPSHOT.war&lt;/web-uri&gt;
        &lt;context-root&gt;/api&lt;/context-root&gt;
      &lt;/web&gt;
    &lt;/module&gt;
    &lt;module&gt;
      &lt;ejb&gt;myapp-ejb-1.0.0-SNAPSHOT.jar&lt;/ejb&gt;
    &lt;/module&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>The EJB application contains a singleton EJB, annotated with @Singleton, @LocalBean and @Startup, which contains a @Schedule method.</p>
  
  <p>I noticed in the log that the server started three instances of the scheduled method simultaneously, and further investigation of the log shows that the bean gets bound three times - one for each application in the ear. </p>
  
  <p>This is in accordance with the documentation <a href="http://docs.oracle.com/javaee/6/tutorial/doc/gipjg.html" rel="nofollow noreferrer">http://docs.oracle.com/javaee/6/tutorial/doc/gipjg.html</a></p>
  
  <p>BUT: I have a similar application running on the full profile WebSphere server that don't show this behavior. Instead, only one instance exists for the entire Enterprise application.</p>
  
  <p>The WLP server is running 17.0.0.1 with Java version 1.8.0_101</p>
  
  <p>The question is, if this is an error - or am I missing some important setting in WLP?</p>