我在Windows 10上开发了spring boot micro服务,它运行正常。在部署到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无法使用sdkman安装的Java运行该应用程序。
我怀疑是因为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 :