Я разработал микро-сервис весенней загрузки на Windows 10, и он работает без проблем. после развертывания на своем экземпляре aws ec2 я могу работать с java -jar app.jar
, однако, если я использую systemctl для его запуска, это дает мне The web application [ROOT] appears to have started a thread named [RxIoScheduler-1 (Evictor)] but has failed to stop
я установил два java 11, один использует yum install java
,другая причина - sdk install java
, причина, по которой я установил две версии java, заключается в том, что systemctl не может запустить приложение с установленной программой java sdkman.
Я подозреваю, что это потому, что systemctl всегда запускается под пользователем root.
я также пытался поместить его в файл .sh
мой файл app.service:
[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
это сообщение об ошибке:
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 :