找不到类'org.apache.oro.text.regex.Perl5Matcher'

时间:2015-05-12 00:53:11

标签: java android apache ftp

我过去4或5天一直在使用FTP奥德赛,这个问题已在此处详细记录:FTP to 1and1.com

起初我只是想上传一个文件,但现在我已经开始看看我能不能上班了。我正在尝试列出目录中的文件。我在更改目录时获得成功响应,然后调用下面的代码列出内容。

FTPFile[] f =  mFtpClient.listFiles("/images_in");
for (FTPFile thisFile : f) {
    Log.e("FTPList", thisFile.getRawListing());
}  

这是在try / catch块中,但当它到达第一行时,代码进入AsyncTask.java,然后程序崩溃。日志输出如下。我似乎错过了一个名为org.apache.oro.text.regex.Perl5Matcher的类。这是一个jar文件,我将在项目中包含一个import语句,还是一个java类文件,我将像其他任何java类一样添加?我用Google搜索并发现了一些类似名称但没有确定性的Java类文件。

格雷格

05-11 17:37:04.694    6518-6555/com.packagename.ftptest E/dalvikvm﹕ Could not find class 'org.apache.oro.text.regex.Perl5Matcher', referenced from method org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl.<init>
05-11 17:37:04.694    6518-6555/com.packagename.ftptest W/dalvikvm﹕ VFY: unable to resolve new-instance 1809 (Lorg/apache/oro/text/regex/Perl5Matcher;) in Lorg/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl;
05-11 17:37:04.704    6518-6555/com.packagename.ftptest W/dalvikvm﹕ VFY: unable to resolve exception class 1804 (Lorg/apache/oro/text/regex/MalformedPatternException;)
05-11 17:37:04.704    6518-6555/com.packagename.ftptest W/dalvikvm﹕ VFY: unable to find exception handler at addr 0x1d
05-11 17:37:04.704    6518-6555/com.packagename.ftptest W/dalvikvm﹕ VFY:  rejected Lorg/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl;.<init> (Ljava/lang/String;)V
05-11 17:37:04.704    6518-6555/com.packagename.ftptest W/dalvikvm﹕ VFY:  rejecting opcode 0x0d at 0x001d
05-11 17:37:04.704    6518-6555/com.packagename.ftptest W/dalvikvm﹕ VFY:  rejected Lorg/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl;.<init> (Ljava/lang/String;)V
05-11 17:37:04.704    6518-6555/com.packagename.ftptest W/dalvikvm﹕ Verifier rejected class Lorg/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl;
05-11 17:37:08.739    6518-6518/com.packagename.ftptest I/Choreographer﹕ Skipped 52 frames!  The application may be doing too much work on its main thread.
05-11 17:37:10.120    6518-6555/com.packagename.ftptest W/dalvikvm﹕ threadid=12: thread exiting with uncaught exception (group=0x416d0e18)
05-11 17:37:13.424    6518-6555/com.packagename.ftptest E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
Process: com.packagename.ftptest, PID: 6518
java.lang.RuntimeException: An error occured while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:300)
        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
        at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
        at java.util.concurrent.FutureTask.run(FutureTask.java:242)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:864)
 Caused by: java.lang.VerifyError: org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl
        at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createNTFTPEntryParser(DefaultFTPFileEntryParserFactory.java:184)
        at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:102)
        at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2358)
        at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2141)
        at com.packagename.ftptest.MainActivity$UpdateDataTask.doInBackground(MainActivity.java:196)
        at com.packagename.ftptest.MainActivity$UpdateDataTask.doInBackground(MainActivity.java:163)
        at android.os.AsyncTask$2.call(AsyncTask.java:288)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
  atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:864)

1 个答案:

答案 0 :(得分:0)

在commons-net-3.6-bin.zip中使用commons-net-3.6.jar。