3

when I startup tomcat in linux,I met a problem. Using CLASSPATH:/data/apache-tomcat-7.0.47/bin/bootstrap.jar:/data/apache-tomcat-7.0.47/bin/tomcat-juli.jar

`Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) 
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 1 more`

I know that class can't be found,but the jar has been in the classpath. So why? I will be appreciated if you can answer my question.thank you.

user3155758
  • 31
  • 1
  • 1
  • 2
  • 1
    can u share your classpath also? – Juned Ahsan Jan 03 '14 at 03:40
  • when ./catalina.sh run it shows "Using CLASSPATH: /data/apache-tomcat-7.0.47/bin/bootstrap.jar:/data/apache-tomcat-7.0.47/bin/tomcat-juli.jar" – user3155758 Jan 03 '14 at 03:42
  • Seems like LogFactory might require a class from a jar not on your classpath, or is not in the jars you've listed. Possibly a duplicate of http://stackoverflow.com/questions/7955442/java-lang-noclassdeffounderror-org-apache-juli-logging-logfactory?rq=1 – nitind Jan 03 '14 at 08:39
  • There is definitely something wrong with `tomcat-juli.jar`. Maybe the file is demaged. – Pavel Horal Jan 03 '14 at 08:50
  • I experience this problem regularly when I start Tomcat from Eclipse (might not apply in your case). Running "Clean..." from the context menu in the server view fixes it. It seems to be a synchronization problem between the Eclipse workspace and the Tomcat working directory. – Codo Jan 01 '15 at 09:43
  • Seems like your tomcat installation is broken – rkosegi Mar 15 '16 at 05:25

3 Answers3

1

In my case the error was in skiped quotes "" after --Classpath. The correct run script is

%CATALINA_HOME%\bin\tomcat7 //IS//Tomcat7 --DisplayName="Apache Tomcat 7" --Install="C:\tomcat-7.0\bin\tomcat7.exe" --Jvm=auto --StartMode=jvm --StopMode=jvm --Classpath="%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_HOME%\bin\tomcat-juli.jar" --StartClass=org.apache.catalina.startup.Bootstrap --StartParams=start --StopClass=org.apache.catalina.startup.Bootstrap --StopParams=stop
0

Well I also underwent the same problem while I started the tomcat. But after following changes it started working properly. So you better add the below mentioned jars to your classpath and start the tomcat server again.

  • bootstrap.jar
  • common-daemon.jar
  • tomcat-juli.jar

As you already have 'bootstrap.jar' and 'tomcat-juli.jar', add 'common-daemon.jar' to the classpath and start the server.

Cheers !!

Du-Lacoste
  • 11,530
  • 2
  • 71
  • 51
-1

Goto Project->clean and clean your project. will resolve your problem

alok
  • 2,718
  • 21
  • 17