简体   繁体   English

Tomcat 8无法启动

[英]Tomcat 8 won't start

I've been searching quite a bit, but can't find the answer. 我已经搜索了很多,但是找不到答案。 I just upgraded STS (from 3.2) so I could try out Tomcat 8 (from 7.0.53). 我刚刚升级了STS(从3.2版开始),因此可以尝试Tomcat 8(从7.0.53版开始)。 I've got STS 3.6.2 and Tomcat 8.0.15. 我有STS 3.6.2和Tomcat 8.0.15。 After adding the TC8 server and configuring it it refuses to start, with this root error: 添加TC8服务器并对其进行配置后,它拒绝启动,并出现以下根本错误:

java.lang.ClassNotFoundException: org.apache.juli.WebappProperties

So I read up quite a bit and found this guide to switching from hard-coded commons-logging via Juli to Log4J and followed it to the letter without any luck. 因此,我读了很多书,发现了本指南,它涉及从通过Juli进行硬编码的公共记录到Log4J的切换,然后又顺其自然地完成了工作。 A relevant excerpt: 相关摘录:

The internal logging for Apache Tomcat uses JULI, a packaged renamed fork of Apache Commons Logging that, by default, is hard-coded to use the java.util.logging framework. Apache Tomcat的内部日志记录使用JULI,这是Apache Commons Logging的打包的重命名的fork,默认情况下,它经过硬编码以使用java.util.logging框架。 This ensures that Tomcat's internal logging and any web application logging will remain independent, even if a web application uses Apache Commons Logging. 这样可以确保Tomcat的内部日志记录和任何Web应用程序日志都将保持独立,即使Web应用程序使用Apache Commons Logging。

To configure Tomcat to use an alternative logging framework for its internal logging, one has to replace the JULI impementation that is hard-coded to use java.util.logging with a JULI implementation that retains the full Commons Logging discovery mechanism. 为了配置Tomcat在其内部日志记录中使用替代日志记录框架,必须使用保留完整的Commons Logging发现机制的JULI实现来替换硬编码为使用java.util.logging的JULI实现。 Such an implementation is provided as an extras component. 此类实现作为附加组件提供。 Instructions on how to configure Tomcat to use Log4j framework for its internal logging may be found below. 有关如何配置Tomcat以将Log4j框架用于其内部日志记录的说明,可以在下面找到。

I also found this answer (to a different question) and this question from here, where the latter appears to have a nearly identical problem without any solution. 我也找到了这个答案 (针对另一个问题),也从这里找到了这个问题 ,这里的后者似乎有几乎相同的问题,没有任何解决方案。

I've searched all JARs in my Tomcat's bin/lib folders and found no such class (including various versions of tomcat-juli.jar and tomcat-juli-adapters.jar ). 我已经在Tomcat的bin / lib文件夹中搜索了所有JAR,但没有找到这样的类(包括tomcat-juli.jartomcat-juli-adapters.jar各种版本)。 I find barely any reference on the internet to this class/interface except on the Tomcat 8 Logging guide linked earlier. 除了在前面链接的《 Tomcat 8日志记录》指南之外,在互联网上几乎找不到对该类/接口的任何引用。 So, the question is: Why is Tomcat looking for this class? 因此,问题是:Tomcat为什么要寻找此类?

Again from the linked guide, here's what it says: 再次从链接指南中可以看到以下内容:

If using a class loader that implements the org.apache.juli.WebappProperties interface (Tomcat's web application class loader does) then property replacement is also performed for ${classloader.webappName} , ${classloader.hostName} and ${classloader.serviceName} which are replaced with the web application name, the host name and the service name respectively. 如果使用实现org.apache.juli.WebappProperties接口的类加载器(Tomcat的Web应用程序类加载器实现),则还将对${classloader.webappName}${classloader.hostName}${classloader.serviceName}分别替换为Web应用程序名称,主机名和服务名。

Why is my Tomcat class loader not actually implementing that then, or why isn't it finding it? 为什么我的Tomcat类加载器实际上没有实现,或者为什么找不到呢?

Our Ant Tomcat configuration process copied Tomcat 7's tomcat-juli.jar over to Tomcat 8, causing the issue. 我们的Ant Tomcat配置过程将Tomcat 7的tomcat-juli.jar复制到Tomcat 8,从而导致了问题。

Getting the correct tomcat-juli.jar for Tomcat 8 from Apache's Tomcat Extras section fixed the issue. 从Apache的Tomcat Extras部分获取适用于Tomcat 8的正确tomcat-juli.jar可以解决此问题。

That interface is in tomcat-juli.jar and Tomcat's web application class loader implements that interface. 该接口位于tomcat-juli.jar中,Tomcat的Web应用程序类加载器实现了该接口。

You do not need to switch to log4j based logging to fix this issue. 您无需切换到基于log4j的日志记录即可解决此问题。

tomcat-juli.jar (which should be in the bin directory) appears to be missing from a class path somewhere. 在某处的类路径中似乎缺少tomcat-juli.jar(应位于bin目录中)。 Not sure if this is configuration error on your part of something that needs tweaking Eclipse's integration for Apache Tomcat. 不确定这是否是您需要配置错误的部分,需要调整Eclipse与Apache Tomcat的集成。

I suggest you start with a clean Tomcat 8.0.15 install from the ASF, make sure that works from the command line and then try integrating that with STS/Eclipse. 我建议您从ASF进行全新的Tomcat 8.0.15安装,确保从命令行运行,然后尝试将其与STS / Eclipse集成。

Check the version on Tomcat that you're using. 在您使用的Tomcat上检查版本。 We expect Tomcat 8.5.4 or higher by default now. 我们期望现在默认情况下是Tomcat 8.5.4或更高版本。 If you want to use an older version you'll need to add tomcat-juli as documented in the release notes 如果要使用旧版本,则需要按照发行说明中的​​说明添加tomcat-juli

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM