It's not a secret anymore!
The moose likes Ant, Maven and Other Build Tools and the fly likes NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "NoClassDefFoundError" Watch "NoClassDefFoundError" New topic


Ankur Sharma

Joined: Nov 30, 2007
Posts: 21

I am using ANT with Eclipse with Tomcat.

I am getting following error when I am trying to run a FTP target:

Could not create type ftp due to java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClientConfig

Here is my FTP target:

<target name="ftp">
<ftp server="" remotedir="/test" userid="user" password="password" depends="no">
<fileset dir="${meta.home}">
<include name="**/context.xml" />

Please reply if you know why it's happening.

I have also added ant 1.7 lib to my classpath, that did not help either.


Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

1. Where did you put Jakarta's Common Net library ?
2. Your target does not seem to use a classpath. How did you define the classpath, and is the above library in it ?

[My Blog]
All roads lead to JavaRanch
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
See also

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Andrew Och
Ranch Hand

Joined: Mar 19, 2004
Posts: 32
I had the same error message, but only in Eclipse (version 3.3).

I did not get the error on command line. I had setup up ANT_HOME variable correctly and copied the jakarta-oro-2.0.8.jar and commons-net-1.4.1.jar to %ANT_HOME%\lib

However it seems that the ANT Eclipse module does not automatically parse the %ANT_HOME%\lib directory for new jars and I had to add them manually

(preferences->Ant->Runtime, Classpath tab, Ant Home Entries -> Add External JARs...)

Then it worked.
saidi Bandi
Ranch Hand

Joined: Apr 07, 2007
Posts: 64

may be the below link is help full for you.
I agree. Here's the link:
subject: NoClassDefFoundError
It's not a secret anymore!