无法通过FTP上传文件 - 找不到文件

时间:2014-09-12 12:21:12

标签: android ftp

我写了一个简单的应用程序,它可以从相机中获取所有照片并通过FTP将它们上传到服务器。当我运行应用程序时,我得到一个非常奇怪的例外。

09-12 11:56:08.153: E/ThrottleService(149): problem during onPollAlarm: 
  java.lang.IllegalStateException: problem parsing stats: java.io.FileNotFoundException:
  /proc/net/xt_qtaguid/iface_stat_all: open failed: ENOENT (No such file or directory)

FTP客户端也返回:550 file not found

文件上传代码:

    @Override
    public boolean storeFile(File file) {


        FileInputStream in = null;
        try {
            client.enterLocalActiveMode();
            client.setFileType(FTP.BINARY_FILE_TYPE);
            Log.d(TAG, "File exists: " + file.exists() + " File readabdle: " + file.canRead() + " File writable: " + file.canWrite()); 
            in = new FileInputStream(file);
            boolean result = client.storeFile(file.getName(), in);
            in.close();
            return result;
        } catch (IOException e) {
            e.printStackTrace();
            try {
                in.close();
                return false;
            } catch (IOException e1) {
                e1.printStackTrace();
                return false;
            }
        }
    }

请注意,日志打印:

09-12 12:03:21.701: D/FTPClientApache(745): File exists: true File readabdle: 
true File writable: true

我也尝试启用FTP日志(抱歉这个长度,但我觉得更长=更好):

09-12 12:12:48.541: I/System.out(798): DEBUG [FTPControlSocket] 12 Sep 2014 12:12:48.542 : ListenOnAllInterfaces=true
09-12 12:12:48.562: I/System.out(798): DEBUG [FTPControlSocket] 12 Sep 2014 12:12:48.560 : ---> PORT 10,0,2,15,143,249
09-12 12:12:48.742: I/System.out(798): DEBUG [FTPControlSocket] 12 Sep 2014 12:12:48.742 : 200 Port command successful
09-12 12:12:48.742: I/System.out(798): DEBUG [FTPControlSocket] 12 Sep 2014 12:12:48.744 : ---> STOR test.jpg
09-12 12:12:48.791: I/System.out(798): DEBUG [FTPControlSocket] 12 Sep 2014 12:12:48.797 : 150 Opening data channel for file transfer.
09-12 12:12:48.802: I/System.out(798): DEBUG [FTPActiveDataSocket] 12 Sep 2014 12:12:48.799 : Calling accept()
09-12 12:13:48.822: I/System.out(798): ERROR [FTPClient] 12 Sep 2014 12:13:48.802 : Caught and rethrowing exception in getDataAfterInitGet() : null
09-12 12:13:48.822: I/System.out(798): java.net.SocketTimeoutException
09-12 12:13:48.822: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:108)
09-12 12:13:48.831: I/System.out(798):  at java.net.ServerSocket.implAccept(ServerSocket.java:202)
09-12 12:13:48.831: I/System.out(798):  at java.net.ServerSocket.accept(ServerSocket.java:127)
09-12 12:13:48.831: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.acceptConnection(FTPActiveDataSocket.java:185)
09-12 12:13:48.841: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.getOutputStream(FTPActiveDataSocket.java:201)
09-12 12:13:48.841: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.getOutputStream(FTPClient.java:3318)
09-12 12:13:48.841: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2877)
09-12 12:13:48.852: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2604)
09-12 12:13:48.852: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2572)
09-12 12:13:48.852: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:857)
09-12 12:13:48.852: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:831)
09-12 12:13:48.861: I/System.out(798):  at service.FTPClientEDT.storeFile(FTPClientEDT.java:62)
09-12 12:13:48.861: I/System.out(798):  at service.FTPService.uploadFiles(FTPService.java:74)
09-12 12:13:48.861: I/System.out(798):  at service.FTPService.onHandleIntent(FTPService.java:168)
09-12 12:13:48.861: I/System.out(798):  at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-12 12:13:48.861: I/System.out(798):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-12 12:13:48.861: I/System.out(798):  at android.os.Looper.loop(Looper.java:137)
09-12 12:13:48.871: I/System.out(798):  at android.os.HandlerThread.run(HandlerThread.java:60)
09-12 12:13:48.871: I/System.out(798): Caused by: libcore.io.ErrnoException: accept failed: EAGAIN (Try again)
09-12 12:13:48.871: I/System.out(798):  at libcore.io.Posix.accept(Native Method)
09-12 12:13:48.881: I/System.out(798):  at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:55)
09-12 12:13:48.881: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:98)
09-12 12:13:48.881: I/System.out(798):  ... 17 more
09-12 12:13:48.881: I/System.out(798): java.net.SocketTimeoutException
09-12 12:13:48.881: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:108)
09-12 12:13:48.881: I/System.out(798):  at java.net.ServerSocket.implAccept(ServerSocket.java:202)
09-12 12:13:48.881: I/System.out(798):  at java.net.ServerSocket.accept(ServerSocket.java:127)
09-12 12:13:48.892: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.acceptConnection(FTPActiveDataSocket.java:185)
09-12 12:13:48.892: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.getOutputStream(FTPActiveDataSocket.java:201)
09-12 12:13:48.902: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.getOutputStream(FTPClient.java:3318)
09-12 12:13:48.902: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2877)
09-12 12:13:48.902: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2604)
09-12 12:13:48.935: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2572)
09-12 12:13:48.935: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:857)
09-12 12:13:48.935: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:831)
09-12 12:13:48.935: I/System.out(798):  at service.FTPClientEDT.storeFile(FTPClientEDT.java:62)
09-12 12:13:48.935: I/System.out(798):  at service.FTPService.uploadFiles(FTPService.java:74)
09-12 12:13:48.935: I/System.out(798):  at service.FTPService.onHandleIntent(FTPService.java:168)
09-12 12:13:48.935: I/System.out(798):  at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-12 12:13:48.935: I/System.out(798):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-12 12:13:48.935: I/System.out(798):  at android.os.Looper.loop(Looper.java:137)
09-12 12:13:48.935: I/System.out(798):  at android.os.HandlerThread.run(HandlerThread.java:60)
09-12 12:13:48.942: I/System.out(798): Caused by: libcore.io.ErrnoException: accept failed: EAGAIN (Try again)
09-12 12:13:48.942: I/System.out(798):  at libcore.io.Posix.accept(Native Method)
09-12 12:13:48.942: I/System.out(798):  at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:55)
09-12 12:13:48.942: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:98)
09-12 12:13:48.942: I/System.out(798):  ... 17 more
09-12 12:13:48.942: I/System.out(798): DEBUG [FTPActiveDataSocket] 12 Sep 2014 12:13:48.947 : close() succeeded
09-12 12:13:48.982: I/System.out(798): DEBUG [FTPClient] 12 Sep 2014 12:13:48.949 : Validate transfer on error after exception : null
09-12 12:13:48.982: I/System.out(798): java.net.SocketTimeoutException
09-12 12:13:48.982: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:108)
09-12 12:13:48.991: I/System.out(798):  at java.net.ServerSocket.implAccept(ServerSocket.java:202)
09-12 12:13:48.991: I/System.out(798):  at java.net.ServerSocket.accept(ServerSocket.java:127)
09-12 12:13:48.991: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.acceptConnection(FTPActiveDataSocket.java:185)
09-12 12:13:48.991: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.getOutputStream(FTPActiveDataSocket.java:201)
09-12 12:13:48.991: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.getOutputStream(FTPClient.java:3318)
09-12 12:13:48.991: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2877)
09-12 12:13:48.991: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2604)
09-12 12:13:48.991: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2572)
09-12 12:13:49.001: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:857)
09-12 12:13:49.001: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:831)
09-12 12:13:49.001: I/System.out(798):  at service.FTPClientEDT.storeFile(FTPClientEDT.java:62)
09-12 12:13:49.001: I/System.out(798):  at service.FTPService.uploadFiles(FTPService.java:74)
09-12 12:13:49.014: I/System.out(798):  at service.FTPService.onHandleIntent(FTPService.java:168)
09-12 12:13:49.014: I/System.out(798):  at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-12 12:13:49.014: I/System.out(798):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-12 12:13:49.014: I/System.out(798):  at android.os.Looper.loop(Looper.java:137)
09-12 12:13:49.014: I/System.out(798):  at android.os.HandlerThread.run(HandlerThread.java:60)
09-12 12:13:49.014: I/System.out(798): Caused by: libcore.io.ErrnoException: accept failed: EAGAIN (Try again)
09-12 12:13:49.022: I/System.out(798):  at libcore.io.Posix.accept(Native Method)
09-12 12:13:49.022: I/System.out(798):  at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:55)
09-12 12:13:49.022: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:98)
09-12 12:13:49.031: I/System.out(798):  ... 17 more
09-12 12:13:49.031: I/System.out(798): java.net.SocketTimeoutException
09-12 12:13:49.031: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:108)
09-12 12:13:49.031: I/System.out(798):  at java.net.ServerSocket.implAccept(ServerSocket.java:202)
09-12 12:13:49.031: I/System.out(798):  at java.net.ServerSocket.accept(ServerSocket.java:127)
09-12 12:13:49.041: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.acceptConnection(FTPActiveDataSocket.java:185)
09-12 12:13:49.041: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.getOutputStream(FTPActiveDataSocket.java:201)
09-12 12:13:49.041: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.getOutputStream(FTPClient.java:3318)
09-12 12:13:49.041: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2877)
09-12 12:13:49.041: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2604)
09-12 12:13:49.041: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2572)
09-12 12:13:49.051: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:857)
09-12 12:13:49.081: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:831)
09-12 12:13:49.081: I/System.out(798):  at service.FTPClientEDT.storeFile(FTPClientEDT.java:62)
09-12 12:13:49.081: I/System.out(798):  at service.FTPService.uploadFiles(FTPService.java:74)
09-12 12:13:49.081: I/System.out(798):  at service.FTPService.onHandleIntent(FTPService.java:168)
09-12 12:13:49.081: I/System.out(798):  at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-12 12:13:49.081: I/System.out(798):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-12 12:13:49.081: I/System.out(798):  at android.os.Looper.loop(Looper.java:137)
09-12 12:13:49.081: I/System.out(798):  at android.os.HandlerThread.run(HandlerThread.java:60)
09-12 12:13:49.091: I/System.out(798): Caused by: libcore.io.ErrnoException: accept failed: EAGAIN (Try again)
09-12 12:13:49.091: I/System.out(798):  at libcore.io.Posix.accept(Native Method)
09-12 12:13:49.091: I/System.out(798):  at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:55)
09-12 12:13:49.091: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:98)
09-12 12:13:49.102: I/System.out(798):  ... 17 more
09-12 12:13:49.131: I/System.out(798): DEBUG [FTPControlSocket] 12 Sep 2014 12:13:49.137 : 425 Can't open data connection.
09-12 12:13:49.131: I/System.out(798): INFO [FTPControlSocket] 12 Sep 2014 12:13:49.139 : Expected reply codes = [225,226,250]
09-12 12:13:49.152: D/dalvikvm(798): GC_CONCURRENT freed 633K, 11% free 6269K/6983K, paused 15ms+32ms, total 98ms
09-12 12:13:49.152: I/System.out(798): WARN [FTPClient] 12 Sep 2014 12:13:49.141 : Validate transfer on error failed : Can't open data connection.
09-12 12:13:49.152: I/System.out(798): com.enterprisedt.net.ftp.FTPException: 425 Can't open data connection.
09-12 12:13:49.152: I/System.out(798):  at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1235)
09-12 12:13:49.152: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2645)
09-12 12:13:49.152: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.validateTransferOnError(FTPClient.java:2664)
09-12 12:13:49.152: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2615)
09-12 12:13:49.152: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2572)
09-12 12:13:49.152: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:857)
09-12 12:13:49.152: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:831)
09-12 12:13:49.152: I/System.out(798):  at service.FTPClientEDT.storeFile(FTPClientEDT.java:62)
09-12 12:13:49.162: I/System.out(798):  at service.FTPService.uploadFiles(FTPService.java:74)
09-12 12:13:49.162: I/System.out(798):  at service.FTPService.onHandleIntent(FTPService.java:168)
09-12 12:13:49.162: I/System.out(798):  at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-12 12:13:49.162: I/System.out(798):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-12 12:13:49.162: I/System.out(798):  at android.os.Looper.loop(Looper.java:137)
09-12 12:13:49.162: I/System.out(798):  at android.os.HandlerThread.run(HandlerThread.java:60)
09-12 12:13:49.162: I/System.out(798): com.enterprisedt.net.ftp.FTPException: 425 Can't open data connection.
09-12 12:13:49.162: I/System.out(798):  at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1235)
09-12 12:13:49.162: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2645)
09-12 12:13:49.171: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.validateTransferOnError(FTPClient.java:2664)
09-12 12:13:49.171: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2615)
09-12 12:13:49.171: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2572)
09-12 12:13:49.171: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:857)
09-12 12:13:49.171: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:831)
09-12 12:13:49.171: I/System.out(798):  at service.FTPClientEDT.storeFile(FTPClientEDT.java:62)
09-12 12:13:49.171: I/System.out(798):  at service.FTPService.uploadFiles(FTPService.java:74)
09-12 12:13:49.182: I/System.out(798):  at service.FTPService.onHandleIntent(FTPService.java:168)
09-12 12:13:49.182: I/System.out(798):  at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-12 12:13:49.182: I/System.out(798):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-12 12:13:49.182: I/System.out(798):  at android.os.Looper.loop(Looper.java:137)
09-12 12:13:49.182: I/System.out(798):  at android.os.HandlerThread.run(HandlerThread.java:60)
09-12 12:13:49.182: I/System.out(798): DEBUG [FTPClient] 12 Sep 2014 12:13:49.188 : Sleeping for 5000 ms prior to retry
09-12 12:13:54.201: I/System.out(798): ERROR [FTPClient] 12 Sep 2014 12:13:54.194 : Transfer error on attempt #2 retrying:  : null
09-12 12:13:54.201: I/System.out(798): java.net.SocketTimeoutException
09-12 12:13:54.211: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:108)
09-12 12:13:54.211: I/System.out(798):  at java.net.ServerSocket.implAccept(ServerSocket.java:202)
09-12 12:13:54.211: I/System.out(798):  at java.net.ServerSocket.accept(ServerSocket.java:127)
09-12 12:13:54.211: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.acceptConnection(FTPActiveDataSocket.java:185)
09-12 12:13:54.221: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.getOutputStream(FTPActiveDataSocket.java:201)
09-12 12:13:54.221: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.getOutputStream(FTPClient.java:3318)
09-12 12:13:54.221: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2877)
09-12 12:13:54.232: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2604)
09-12 12:13:54.232: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2572)
09-12 12:13:54.232: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:857)
09-12 12:13:54.241: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:831)
09-12 12:13:54.241: I/System.out(798):  at service.FTPClientEDT.storeFile(FTPClientEDT.java:62)
09-12 12:13:54.241: I/System.out(798):  at service.FTPService.uploadFiles(FTPService.java:74)
09-12 12:13:54.251: I/System.out(798):  at service.FTPService.onHandleIntent(FTPService.java:168)
09-12 12:13:54.251: I/System.out(798):  at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-12 12:13:54.251: I/System.out(798):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-12 12:13:54.251: I/System.out(798):  at android.os.Looper.loop(Looper.java:137)
09-12 12:13:54.251: I/System.out(798):  at android.os.HandlerThread.run(HandlerThread.java:60)
09-12 12:13:54.251: I/System.out(798): Caused by: libcore.io.ErrnoException: accept failed: EAGAIN (Try again)
09-12 12:13:54.261: I/System.out(798):  at libcore.io.Posix.accept(Native Method)
09-12 12:13:54.261: I/System.out(798):  at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:55)
09-12 12:13:54.261: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:98)
09-12 12:13:54.261: I/System.out(798):  ... 17 more
09-12 12:13:54.261: I/System.out(798): java.net.SocketTimeoutException
09-12 12:13:54.261: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:108)
09-12 12:13:54.261: I/System.out(798):  at java.net.ServerSocket.implAccept(ServerSocket.java:202)
09-12 12:13:54.261: I/System.out(798):  at java.net.ServerSocket.accept(ServerSocket.java:127)
09-12 12:13:54.261: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.acceptConnection(FTPActiveDataSocket.java:185)
09-12 12:13:54.261: I/System.out(798):  at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.getOutputStream(FTPActiveDataSocket.java:201)
09-12 12:13:54.261: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.getOutputStream(FTPClient.java:3318)
09-12 12:13:54.261: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2877)
09-12 12:13:54.261: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2604)
09-12 12:13:54.261: I/System.out(798):  at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2572)
09-12 12:13:54.261: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:857)
09-12 12:13:54.261: I/System.out(798):  at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:831)
09-12 12:13:54.261: I/System.out(798):  at service.FTPClientEDT.storeFile(FTPClientEDT.java:62)
09-12 12:13:54.261: I/System.out(798):  at service.FTPService.uploadFiles(FTPService.java:74)
09-12 12:13:54.261: I/System.out(798):  at service.FTPService.onHandleIntent(FTPService.java:168)
09-12 12:13:54.261: I/System.out(798):  at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-12 12:13:54.261: I/System.out(798):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-12 12:13:54.261: I/System.out(798):  at android.os.Looper.loop(Looper.java:137)
09-12 12:13:54.272: I/System.out(798):  at android.os.HandlerThread.run(HandlerThread.java:60)
09-12 12:13:54.272: I/System.out(798): Caused by: libcore.io.ErrnoException: accept failed: EAGAIN (Try again)
09-12 12:13:54.272: I/System.out(798):  at libcore.io.Posix.accept(Native Method)
09-12 12:13:54.272: I/System.out(798):  at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:55)
09-12 12:13:54.282: I/System.out(798):  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:98)
09-12 12:13:54.282: I/System.out(798):  ... 17 more
09-12 12:13:54.291: I/System.out(798): INFO [FTPClient] 12 Sep 2014 12:13:54.285 : Resume=true
09-12 12:13:54.291: I/System.out(798): DEBUG [FTPClient] 12 Sep 2014 12:13:54.293 : Attempt #3
****09-12 12:13:54.291: I/System.out(798): DEBUG [FTPControlSocket] 12 Sep 2014 12:13:54.298 : ---> SIZE test.jpg
09-12 12:13:54.341: I/System.out(798): DEBUG [FTPControlSocket] 12 Sep 2014 12:13:54.346 : 550 File not found
09-12 12:13:54.341: I/System.out(798): INFO [FTPControlSocket] 12 Sep 2014 12:13:54.349 : Expected reply code = [213]
09-12 12:13:54.352: I/System.out(798): WARN [FTPClient] 12 Sep 2014 12:13:54.351 : SIZE failed 'test.jpg' - resume will not be used (File not found)****

我尝试了edtFTPj / Free和Apache的公共库。我有一个抽象类,有三个方法 - connect,storeFile和disconnect,所以我可以轻松地在这两个库之间切换,而无需更改代码。

0 个答案:

没有答案