title: ContextLoader - Root WebApplicationContext initialized 3 times on ubuntu tomcat
body: <p>Dears,
  I have a jersey - spring api deployed on apache tomcat 9.0.46. (Jersey to handle restful services JAX-RS and Spring to handle all my beans{controllers, DAO, SessionFactory, JPA etc...}).
  Everything works fine on tomcat 9 on windows...
  When deploying the exact same war in ubuntu tomcat 9.0.46, the ContextLoader is getting triggered 3 times and I have all my singletons instantiated 3 times. I'm deploying the api on tomcat ports 80 and 443 (https - godady certificate).
  once I start tomcat the war is deployed and ports 80 and 443 get started (netstat -tulnp | grep java) and I see in log all singletons instantiated. (pool-2) Applicationcontext class my custom spring @Configuration class and it is getting triggered and DB is accessed without any issues</p>
  <pre><code>2021-06-09 14:41:52,128 1104 [main] INFO  o.s.web.context.ContextLoader - Root WebApplicationContext initialized in 905 ms
  2021-06-09 14:41:53,124 2100 [pool-2-thread-1] INFO  skd.app.core.ApplicationContext - TASK::cleanExpiredStatuses
  </code></pre>
  <p>then the server takes few minutes (around 10 minutes 14:41 above then 14:51 below) and when port 8005 is started I see again the ContextLoader is triggered again 2 times.</p>
  <pre><code>09-Jun-2021 14:51:36.196 WARNING [main] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [584,064] milliseconds.
  09-Jun-2021 14:51:36.592 INFO [main] org.glassfish.jersey.server.ApplicationHandler.initialize Initiating Jersey application, version Jersey: 2.6 2014-02-18 21:52:53...
  09-Jun-2021 14:51:37.042 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/apache-tomcat-9.0.46/webapps/skd-service.war] has finished in [588,185] ms
  
  2021-06-09 14:51:39,388 696  [main] INFO  o.s.web.context.ContextLoader - Root WebApplicationContext initialized in 581 ms
  09-Jun-2021 14:51:39.632 INFO [main] org.glassfish.jersey.server.ApplicationHandler.initialize Initiating Jersey application, version Jersey: 2.6 2014-02-18 21:52:53...
  09-Jun-2021 14:51:40.013 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/apache-tomcat-9.0.46/webapps/skd-service.war]
  </code></pre>
  <p>and again for the 3rd time:</p>
  <pre><code>2021-06-09 14:51:41,989 744  [main] INFO  o.s.web.context.ContextLoader - Root WebApplicationContext initialized in 605 ms
  09-Jun-2021 14:51:42.232 INFO [main] org.glassfish.jersey.server.ApplicationHandler.initialize Initiating Jersey application, version Jersey: 2.6 2014-02-18 21:52:53...
  09-Jun-2021 14:51:42.602 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/apache-tomcat-9.0.46/webapps/skd-service.war] has finished in [2,590] ms
  </code></pre>
  <p>Everything is working fine in windows, only when deploying to ubuntu tomcat, I'm getting this.
  Does anyone have a clue why this difference in tomcat behaviour between windows and ubuntu for the same exact WAR file?</p>