Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8343465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:04:21+00:00 2026-06-09T06:04:21+00:00

I am using Log4j in a java web app. Now, when I run a

  • 0

I am using Log4j in a java web app.

Now, when I run a servlet of that web app, this is the error message that I get–

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoClassDefFoundError: org/apache/log4j/Logger
com.test.ConfigHelper.<clinit>(ConfigHelper.java:45)
com.test.runsinglecrawljob.doGet(runsinglecrawljob.java:126)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause


java.lang.ClassNotFoundException: org.apache.log4j.Logger
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
com.test.ConfigHelper.<clinit>(ConfigHelper.java:45)
com.test.runsinglecrawljob.doGet(runsinglecrawljob.java:126)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

Now the line of code in ConfigHelper.java (line 45) is given below—

protected static final Logger log = Logger.getLogger(ConfigHelper.class);

I checked Java Build Path– the JAR file for log4j has been added to build path.

What am I doing wrong here? How do I make log4j work without any problems?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:04:23+00:00Added an answer on June 9, 2026 at 6:04 am

    I checked Java Build Path– the JAR file for log4j has been added to build path.

    Being part of the build path isn’t enough – you need to make sure it’s available at execution time, for example by putting it in the WEB-INF/lib directory in your web application, or potentially in the library path of your servlet container.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a java web app with maven. i'm using jetty to run it
For an java web application, I got this error when using JRE 1.6.0_22 java.lang.SecurityException:
I have a medium-size Java Web-application using Log4J as logging-framework. Right now i am
I'm using log4j in an app I'm developing to eventually run inside Tomcat/JBoss, but
I'm using Java Logging API in a simple Servlet application that uses Maven and
Using org.apache.log4j.jdbc.JDBCAppender , how can I get stracktraces logged with warn and error into
I've made an app init function that I'm using both in Java and GWT
I'm writing a Flex app on top of a Java web application using BlazeDS.
I programmed a Web Application with Java EE. I am using log4j and Tomcat
I am using maven and log4j, but the app cannot load log4j.properties that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.