linux中的tomcat:java.lang.NoClassDefFoundError:org/apache/juli/logging/LogFactory

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20896124/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 05:03:48  来源:igfitidea点击:

tomcat in linux:java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory

javaapachetomcattomcat-juli

提问by user3155758

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

我在linux下启动tomcat的时候遇到了一个问题。 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.run(URLClassLoader.java:366) 
at java.net.URLClassLoader.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.

我知道找不到该类,但该 jar 已在类路径中。所以为什么?如果您能回答我的问题,我将不胜感激。谢谢。

回答by Dulith De Costa

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.

好吧,当我启动 tomcat 时,我也遇到了同样的问题。但是在进行更改后,它开始正常工作。所以你最好将下面提到的 jars 添加到你的类路径中,然后再次启动 tomcat 服务器。

  • bootstrap.jar
  • common-daemon.jar
  • tomcat-juli.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.

由于您已经有了“bootstrap.jar”和“tomcat-juli.jar”,将“ common-daemon.jar”添加到类路径并启动服务器。

Cheers !!

干杯!!

回答by Georgii Goriachev

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

在我的情况下,错误是在 --Classpath 之后跳过引号“”。正确的运行脚本是

%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

回答by alok

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

转到项目->清理并清理您的项目。将解决您的问题