1

While I start tomcat, I am getting the following exception. Could you let me know the reason. Here is the complete stacktrace.

java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1438)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.apache.jasper.servlet.JspServlet.<init>(JspServlet.java:61)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

Thanks Shafi

shafi
  • 11
  • 2
  • I am having the exact same problem.The tomcat-juli.jar doesn't contain the logging package, so cannot fulfill the search for org.apache.juli.logging.LogFactory, which is probably located somewhere else. I'm revisiting a project that hasn't had any work done on it for over a year, and the strange thing is that I didn't have this problem before. – belugabob Nov 19 '10 at 09:49
  • To address the issue, I had to copy the tomcat-juli.jar from Tomcat6, into my Tomcat 5 installation. This feels wrong on many levels, not least of which is the fact that when my app was originally developed, Tomcat 6 didn't exist - so I can't understand how the app ran before. – belugabob Nov 24 '10 at 08:17
  • Update: It turned out that there was a copy of catalina.jar in my WEB-INF/Lib directory, and removing it solved the 'juli' issue (and another one too) I have no idea how it got there, so don't ask. – belugabob Nov 26 '10 at 12:30

2 Answers2

1

Just perform following steps:

Tomcat's bootstrap.jar used to reference the file bin/tomcat-juli.jar in it's manifest. That is changing since it forced tomcat to use a specific library. Instead, it has to be added to the -classpath line. Open your server configuration, and add tomcat-juli.jar to the classpath, and it will work.

Nate
  • 31,017
  • 13
  • 83
  • 207
Rupeshit
  • 1,476
  • 1
  • 14
  • 23
0

That sounds like the JAR tomcat-juli.jar is missing or corrupt. Check the Tomcat distribution archive where it should be and install it again.

[EDIT] The stack trace above says org.apache.jasper.servlet.JspServlet wants this class.

Where is JspServlet from? Maybe you have deployed servlet.jar with your web app?

Did you precompile your JSPs or something? Try to recompile them with the version of Tomcat that you use on the server.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • tomcat-juli.jar is already present under tomcat/bin directory. I tried removing it but it's presence or absence is not making any difference. In both cases, I am getting the same error – shafi Sep 27 '10 at 09:07
  • 1
    Check the archive. Maybe it was corrupted somehow. – Aaron Digulla Sep 27 '10 at 10:20
  • The tomcat insatllation is from a fresh download, is exactly the same as the installation that's in a backup of the files as they were over a year ago, and neither of the tomcat-juli.jar files contains the logging package. Is this class located in another jar, as is common in the Java world? – belugabob Nov 19 '10 at 10:27
  • Find out where `org.apache.jasper.servlet.JspServlet` comes from. I have a feeling that you have deployed servlet.jar or jsp.jar or something with your app. – Aaron Digulla Nov 19 '10 at 11:44