Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

please help me to check this problem

843810May 13 2006 — edited Jun 30 2009
I write this program to connect the FTP Server by using the
package commons-net-1.4.1.jar which i download from http://jakarta.apache.org/site/downloads/downloads_commons-net.cgi

the code is below .It is no problem when I compile ,but it causes some problem when i run it .

import org.apache.commons.net.ftp.*;

public class FTP {
public static void main(String[] args) {
try {
FTPClient ftp = new FTPClient();
ftp.connect("10.200.64.89");
ftp.login("upc","upc");
FTPFile[] f = ftp.listFiles();
for(int i = 0 ; i < f.length; i++) {
System.out.println(f.getName());
}
}catch (Exception e) {
e.printStackTrace();
}
}
}

you can view the Exception :

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/oro/text/regex/MalformedPatternException
at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createUnixFTPEntryParser(DefaultFTPFileEntryParserFactory.java:169)
at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:94)
at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2358)
at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2141)
at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2188)
at work.FTP.main(FTP.java:12)


the method ftp.listFiles() can't run successful, but the others method

such as ftp.changeWorkingDirectory() will do what it do.

please someone help tme . Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2009
Added on May 13 2006
10 comments
3,853 views