简体   繁体   中英

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). I've got STS 3.6.2 and Tomcat 8.0.15. After adding the TC8 server and configuring it it refuses to start, with this root error:

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. 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. This ensures that Tomcat's internal logging and any web application logging will remain independent, even if a web application uses 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. 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.

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 ). I find barely any reference on the internet to this class/interface except on the Tomcat 8 Logging guide linked earlier. So, the question is: Why is Tomcat looking for this class?

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.

Why is my Tomcat class loader not actually implementing that then, or why isn't it finding it?

Our Ant Tomcat configuration process copied Tomcat 7's tomcat-juli.jar over to Tomcat 8, causing the issue.

Getting the correct tomcat-juli.jar for Tomcat 8 from Apache's Tomcat Extras section fixed the issue.

That interface is in tomcat-juli.jar and Tomcat's web application class loader implements that interface.

You do not need to switch to log4j based logging to fix this issue.

tomcat-juli.jar (which should be in the bin directory) appears to be missing from a class path somewhere. Not sure if this is configuration error on your part of something that needs tweaking Eclipse's integration for 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.

Check the version on Tomcat that you're using. We expect Tomcat 8.5.4 or higher by default now. If you want to use an older version you'll need to add tomcat-juli as documented in the release notes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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