Tomcat 似乎正在运行,但显示“失败”

Tomcat 似乎正在运行,但显示“失败”

我使用 Docker 文件中的 apt-get 在 Debian Jessie 上安装了 Tomcat8。然后我 sudo service tomcat8 start。

这会导致以下错误:

[FAIL] Starting Tomcat servlet engine: tomcat8 failed!

但是,它实际上似乎正在工作,因为我可以通过 localhost 成功连接到默认的 tomcat 主页。(我已验证我没有连接到缓存副本)。

当我查看 /var/lib/tomcat8/logs 中的 catalina.out 日志时,没有看到任何错误:

May 06, 2017 3:37:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat8/webapps/ROOT
May 06, 2017 3:37:27 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that wer
scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
May 06, 2017 3:37:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 924 ms
May 06, 2017 3:37:27 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
May 06, 2017 3:37:27 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 967 ms

我想找出这个 FAIL 消息的原因。

答案1

这可能是由于错误加载某些类而导致的,这些类是 docker 运行时的默认类。当您使用默认的 tomcat docker 文件时可能会发生这种情况。当您看到 Tomcat 的管理页面时,它正在运行,不用担心。您还可以从 Catalina conf 文件中启用调试日志记录,以在详细日志中查看缺失的类信息。

相关内容