简体   繁体   English

异常:java.lang.NoClassDefFoundError:org / apache / log4j / PropertyConfigurator

[英]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.

相关问题 java.lang.NoClassDefFoundError:org / apache / log4j / PropertyConfigurator - java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator 尝试在插件类型项目中添加log4j。 错误:java.lang.NoClassDefFoundError:org / apache / log4j / PropertyConfigurator - Trying to add log4j in plugin type project. Error : java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator java.lang.NoClassDefFoundError:org / apache / log4j / Priority - java.lang.NoClassDefFoundError: org/apache/log4j/Priority java.lang.NoClassDefFoundError:org / apache / log4j / Priority - java.lang.NoClassDefFoundError: org/apache/log4j/Priority 线程“主”中的异常java.lang.NoClassDefFoundError:org / apache / logging / log4j / LogManager - Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager 线程“ main”中的异常java.lang.NoClassDefFoundError:org / apache / logging / log4j / message / Message - Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/Message 线程“主”java.lang.NoClassDefFoundError 中的异常:org/apache/log4j/ProvisionNode - Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/ProvisionNode 意外异常:java.lang.NoClassDefFoundError:org / apache / log4j / LogManager - unexpected exception: java.lang.NoClassDefFoundError: org/apache/log4j/LogManager Scala:线程“ main”中的异常java.lang.NoClassDefFoundError:org / apache / log4j / LogManager - Scala : Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/log4j/LogManager 线程“main”中的异常 java.lang.NoClassDefFoundError: org/apache/log4j/Layout - Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/log4j/Layout
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM