473,749 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception in thread "main" java.lang.NoCla ssDefFoundError : org/apache/commons/net/ftp

107 New Member
Hai All,

I am Having a problem in the following...

Expand|Select|Wrap|Line Numbers
  1. import org.apache.commons.net.ftp.FTPClient;
  2. import org.apache.commons.net.ftp.FTPFile;
  3. import org.apache.commons.io.FileUtils;
  4. import java.io.IOException;
  5.  
  6. public class Main {
  7.   public static void main(String[] args)throws Exception {
  8.     FTPClient client = new FTPClient();
  9.  
  10.     client.connect("ftp.myprojectplan.com");
  11.     client.login("myprojec_test@myprojectplan.com", "test123");
  12.  
  13.     String[] names = client.listNames();
  14.     for (String name : names) {
  15.       System.out.println("Name = " + name);
  16.     }
  17.  
  18.     FTPFile[] ftpFiles = client.listFiles();
  19.     for (FTPFile ftpFile : ftpFiles) {
  20.       if (ftpFile.getType() == FTPFile.FILE_TYPE) {
  21.         System.out.println("FTPFile: " + ftpFile.getName() + "; "
  22.             + FileUtils.byteCountToDisplaySize(ftpFile.getSize()));
  23.       }
  24.     }
  25.     client.logout();
  26.     client.disconnect();
  27.   }
  28. }
  29.  
  30.  
The error Shows Like

Expand|Select|Wrap|Line Numbers
  1. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/ne
  2. t/ftp/FTPClient
  3.         at Main.main(Main.java:8)
  4. Caused by: java.lang.ClassNotFoundException: org.apache.commons.net.ftp.FTPClien
  5. t
  6.         at java.net.URLClassLoader$1.run(Unknown Source)
  7.         at java.security.AccessController.doPrivileged(Native Method)
  8.         at java.net.URLClassLoader.findClass(Unknown Source)
  9.         at java.lang.ClassLoader.loadClass(Unknown Source)
  10.         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
  11.         at java.lang.ClassLoader.loadClass(Unknown Source)
  12.         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
  13.         ... 1 more
  14.  
Mar 21 '10 #1
1 10091
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
Did you set your class path properly?

Regards
Dheeraj Joshi
Mar 26 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3005
by: Phillip Montgomery | last post by:
Hello all; I'm trying to debug an issue with a java script called, SelectSockets. It appears to be a fairly common one found on the web. I downloaded the SGI Java v1.4.1 installation from SGI's webpage and installed it using SGI's swmgr application. The installation was very straight forward and there were no errors when I installed the package. Then I ran /usr/java2/bin/javac SelectSockets.java to make the SelectSockets.class file.
1
9118
by: Andy Howells | last post by:
Can anybody help me on this? I am getting the below error but have not got a clue why. The file in my classpath eing used has the class that it says is not defined. Any ideas? I am running java version 1.4.0 and WMQ Series version 5.3 with CSD04. Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:67) at...
7
2766
by: news | last post by:
I am pretty new to Java and I just install the JDK1.4.2 03 I am getting an error when I run the class file TestChart.class with the java.exe: Exception in thread "main" java.lang.NoClassDefFoundError: I have several class files in the directory d:\personal\java-ChartGen Chart.class ChartColourScheme.class
4
2633
oll3i
by: oll3i | last post by:
when i try to run the client application java HelloClient -ORBInitialPort 1050 -ORBInitialHost localhost i get an error exception in thread "main" java.lang.NoClassDefFoundError:HelloClient // Copyright and License import HelloApp.*; import org.omg.CosNaming.*;
9
3126
by: jith87 | last post by:
What is ths error.????? I m nw loading the JDBC driver for connection with MySql. Exception in thread "main" java.lang.NoClassDefFoundError: MySQLJDBCDriverTest
3
6443
by: Ananthu | last post by:
Hi This is my codings in order to access mysql database from java. Codings: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement;
9
3285
by: tiyaramunna | last post by:
I am trying to configure my system with Java program just to practice on the coding....when i compile a test.java program i am able to see the class file but i cant run the program ... I am getting the following error Exception in thread "main" java.lang.NoClassDefFoundError: test Caused by: java.lang.ClassNotFoundException: test at java.net.URLClassLoader$1.run(Unknown Source) at...
4
14727
by: jmitch89 | last post by:
I don't why I get this error: Exception in thread "main" java.lang.NoClassDefFoundError The statement below works just fine: java -cp "appframework-1.0.3.jar;swing-worker-1.1.jar";CurrentStrobe.jar com.visionpro.currentstrobe.CurrentStrobeApp However, the statement below produces the error: java -cp "appframework-1.0.3.jar;swing-worker-1.1.jar" -jar CurrentStrobe.jar Exception in thread "main"...
3
7658
by: ohadr | last post by:
hi, i get Exception in thread "main" java.lang.NullPointerException when i run my application. the exact error is: "Exception in thread "main" java.lang.NullPointerException at sortmergejoin.MergeJoin.Field(MergeJoin.java:204) at sortmergejoin.MergeJoin.SMJoin(MergeJoin.java:84) at sortmergejoin.MergeJoin.<init>(MergeJoin.java:34) at sortmergejoin.Main.main(Main.java:24) Java Result: 1"
1
6756
by: onlinegear | last post by:
HI i am writing this for college i know i have loads of combo boxes with nothing in the i havent got that far yet. but every time i run this is comes up with this erro run: Exception in thread "main" java.lang.NullPointerException at java.awt.Container.addImpl(Container.java:1041) at java.awt.Container.add(Container.java:365) at orderingsystem.OrderingSystem.<init>(OrderingSystem.java:261) at...
0
8997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6801
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.