0

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.

2
  • stackoverflow.com/questions/20909446/… Commented Jun 4, 2018 at 5:33
  • @Mr.Roshan I tried some of the things from that thread but it did not worked for me.. Commented Jun 4, 2018 at 5:52

1 Answer 1

1

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. 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. For example:

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.

Sign up to request clarification or add additional context in comments.

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.