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

  • Home
  • SEARCH
  • 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 1958140
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T07:59:52+00:00 2026-05-17T07:59:52+00:00

My java application uses log4j for logging. Using ant the project builds successfully, but

  • 0

My java application uses log4j for logging. Using ant the project builds successfully, but I am unable to run it. The error I get is

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/Log
.........
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.Log

My classpath contains the log4j jar.

[echo] ..../apache-log4j-1.2.15/log4j-1.2.15.jar: .....

My ant version is 1.7.1. What am I missing?

[Edit] My application is referencing another project which required the commons logging jar. So I tried creating an executable jar of the referenced project so that all the dependencies are carried over. The ant task to create the executable jar is as follows:

<target name="executablejar" depends="compile">
        <delete file="${dist}/app.jar" />

        <javac debug="true" srcdir="${src}" destdir="${classes}" classpath="${javac.classpath}"/>

        <copy todir="classes" flatten="true">
            <path>
                  <pathelement path="${javac.classpath}"/>
                </path>
        </copy>
        <jar jarfile="${dist}/app.jar" basedir="${classes}" />
</target>

However the error still persists. Am I creating the executable jar correctly?

  • 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-05-17T07:59:55+00:00Added an answer on May 17, 2026 at 7:59 am

    You may have inadvertently imported a class from org.apache.commons.logging and now, as you might expect, the JVM is expecting to find the class definition on your classpath at runtime.

    I’d recommend looking for usages of the commons-logging package in your code.

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

Sidebar

Related Questions

We have a java web service application that uses log4j to do logging. An
I have a Java web application that currently uses Log4J for logging. I'd like
A library that my java application uses needs looks for a file (log4j.xml) in
Currently our Java application uses the values held within a tab delimited *.cfg file.
I support a legacy Java application that uses flat files (plain text) for persistence.
My application uses loads of Java threads. I am looking for a reliable understanding
My Java application is saving stuff in 'user.home' but on windows this does not
My Java application uses db sessions, via Hibernate. What I want to do is
If Java application requires certain JRE version then how can I check its availability
my java application has a loading task which requires two server calls which can

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.