[英]Exception : java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
While running my application, below exception is thrown: 运行我的应用程序时,抛出以下异常:
Jun 04, 2018 10:37:39 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class com.my.servlet.ContextListener
java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
at com.my.servlet.ContextListener.contextInitialized(ContextListener.java:27)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
Previously the application was working but after machine restart, it starts failing because of above error. 以前,该应用程序正在运行,但是在计算机重新启动后,由于上述错误,它开始失败。
Well, you haven't said what kind of application this is or basically given us any context. 好吧,您没有说这是什么类型的应用程序,或者基本上没有给我们提供任何上下文信息。 You need to make sure that the log4j classes are available to the classloader which is loading your application.
您需要确保log4j类可用于正在加载应用程序的类加载器。 If it's a standalone application run from the commandline, that's like to just be a case of specifying the -classpath command-line option.
如果它是从命令行运行的独立应用程序,则就像是指定-classpath命令行选项的情况一样。 For example:
例如:
java -classpath .;log4j-1.2.8.jar org.foo.MyApplication
java -classpath。; log4j-1.2.8.jar org.foo.MyApplication
If you can give us more information, we're likely to be able to help you more. 如果您可以给我们更多信息,我们很可能会为您提供更多帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.