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.

6
  • 1
    can u share your classpath also? Commented Jan 3, 2014 at 3: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" Commented Jan 3, 2014 at 3: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 stackoverflow.com/questions/7955442/… Commented Jan 3, 2014 at 8:39
  • There is definitely something wrong with tomcat-juli.jar. Maybe the file is demaged. Commented Jan 3, 2014 at 8: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. Commented Jan 1, 2015 at 9:43

3 Answers 3

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
Sign up to request clarification or add additional context in comments.

Comments

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 !!

Comments

-2

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.