wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "NoClassDefFoundError" Watch "NoClassDefFoundError" New topic
Author

NoClassDefFoundError

Ankur Sharma
Greenhorn

Joined: Nov 30, 2007
Posts: 21
Hi,

I am using ANT with Eclipse 3.3.1.1 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="ftp.test.com" remotedir="/test" userid="user" password="password" depends="no">
<fileset dir="${meta.home}">
<include name="**/context.xml" />
</fileset>
</ftp>
</target>

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.

Thanks,

Ankur
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
See also http://ant.apache.org/manual/install.html#librarydependencies


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: 57
Hi,

may be the below link is help full for you.

http://jumpintojava.blogspot.com/2011/01/sloution-to-ant-build-error-error.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoClassDefFoundError
 
Similar Threads
ANT FTP task: Software caused connection abort: connect
error during FTP transfer: org apache commons net MalformedServerReplyException
Unable to download using FTP task
problem in deplying the file on server
ftp error