linux systemctl status tomcat在org.apache. Catalina .valves.AccessLogValve.invoke(AccessLogValve.java:950)返回

lyfkaqu1  于 2023-05-16  发布在  Linux
关注(0)|答案(2)|浏览(116)

我在RHEL 7.2服务器上安装了Apache Http2.4.6和Tomcat 7.0.54,配置了AJP连接器和SSL,并启用了SELinux。当我启动Tomcat服务器时,一切都开始正常,Web应用程序也工作正常。但是,过了一会儿,如果运行# service tomcat statussystemctl status tomcat,我会得到以下输出。

[root@ip-xxx-xxx-xxx-xxx logs]# service tomcat status
Redirecting to /bin/systemctl status  tomcat.service
● tomcat.service - Apache Tomcat Web Application Container
   Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2016-03-24 15:34:30 UTC; 1h 38min ago
  Process: 5929 ExecStop=/usr/libexec/tomcat/server stop (code=exited, status=0/SUCCESS)
 Main PID: 5973 (java)
   CGroup: /system.slice/tomcat.service
           └─5973 /usr/lib/jvm/jre/bin/java -Xms512m -Xmx3072m -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcata...

Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at java.lang.Thread.run(Thread.java:745)

我在Tomcat日志中没有看到任何错误。将SELinux设置为permissive并不能解决这个问题。我如何诊断问题并解决它?

hk8txs48

hk8txs481#

systemctl status tomcat的问题是它只显示来自服务的最新日志条目
其中journalctl -x -u tomcat将显示上次日志循环的日志条目。
关于systemctljournalctl的更多信息

okxuctiv

okxuctiv2#

你好,我修复了这个问题,使用文件配置尝试我第一个tomcat.service,如果不工作,尝试另一个tomcat.service,维斯亦然

首个tomcat.service

[Unit]
Description=Tomcat 9 servlet container
After=network.target

[Service]
Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
Environment=CATALINA_PID=/opt/tomcat9/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat9
Environment=CATALINA_BASE=/opt/tomcat9
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom -Djava.awt.headless=true"

ExecStart=/opt/tomcat9/bin/startup.sh
ExecStop=/opt/tomcat9/bin/shutdown.sh

User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target

第二个tomcat.service

[Unit]
Description=Tomcat
After=network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment="JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64"
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom"
Environment="CATALINA_BASE=/opt/tomcat"
Environment="CATALINA_HOME=/opt/tomcat"
Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh

RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target

如果第一个不工作,请替换为第二个,维斯亦然,请不要忘记使用sudo systemctl reload-daemon sudo systemctl start tomcat sudo systemctl enable tomcat sudo systemctl status tomcat

相关问题