title: systemctl spring boot application The web application [ROOT] appears to have started a thread named
body: <p>I developed the spring boot micro service on my windows 10 and it is running with no problems. after i deploying to my aws ec2 instance, i can run with
   <code>java -jar app.jar</code>
   however if i use systemctl to run it, it gave me 
  <code>The web application [ROOT] appears to have started a thread named [RxIoScheduler-1 (Evictor)] but has failed to stop</code></p>
  
  <p>i installed two java 11, 
  one is using <code>yum install java</code>, 
  the other is <code>sdk install java</code>
  the reason why i installed two java is because systemctl cannot run the app with the java installed by sdkman.</p>
  
  <p>I suspect it is because systemctl is always run under root.</p>
  
  <p>i also have tried put it into .sh file</p>
  
  <p>my app.service file:</p>
  
  <pre><code>[Unit]
  Description=zuul service
  [Service]
  # The configuration file application.properties should be here:
  #change this to your workspace
  User=root
  WorkingDirectory=/home/ec2-user
  #path to executable.
  #executable is a bash script which calls jar file
  ExecStart=/usr/bin/java -jar /home/ec2-user/zuul/target/zuul.jar
  SuccessExitStatus=143
  TimeoutStopSec=10
  RestartSec=5
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>this is the error message:</p>
  
  <pre><code> Stopping service [Tomcat]
  2019-10-31 03:22:14.811  WARN 6973 --- [           main] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [spring.cloud.inetutils] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
   java.base@11.0.5/jdk.internal.misc.Unsafe.park(Native Method)
   java.base@11.0.5/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
   java.base@11.0.5/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
   java.base@11.0.5/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
   java.base@11.0.5/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
   java.base@11.0.5/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
   java.base@11.0.5/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   java.base@11.0.5/java.lang.Thread.run(Thread.java:834)
  2019-10-31 03:22:14.811  WARN 6973 --- [           main] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [RxIoScheduler-1 (Evictor)] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
   java.base@11.0.5/jdk.internal.misc.Unsafe.park(Native Method)
   java.base@11.0.5/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
   java.base@11.0.5/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
   java.base@11.0.5/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
   java.base@11.0.5/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
   java.base@11.0.5/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
   java.base@11.0.5/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
   java.base@11.0.5/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   java.base@11.0.5/java.lang.Thread.run(Thread.java:834)
  2019-10-31 03:22:14.818  INFO 6973 --- [           main] ConditionEvaluationReportLoggingListener :
  </code></pre>