File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError

 
Ankur Sharma
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See also http://ant.apache.org/manual/install.html#librarydependencies
 
Andrew Och
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

may be the below link is help full for you.

http://jumpintojava.blogspot.com/2011/01/sloution-to-ant-build-error-error.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic