簡體   English   中英

java.lang.NoClassDefFoundError:org / apache / commons / vfs / FileSystemException

[英]java.lang.NoClassDefFoundError: org/apache/commons/vfs/FileSystemException

從這里開始遵循示例代碼后,發生了一件奇怪的事情

try {
    String filePath="C:\\srcFolder\\" + fileName;
    String destFolder="\\destFolder";
    int status = SFTP.sendFile(filePath, destFolder, ftpServer, ftpUserName, ftpPassword);
    if(FileTransferStatus.SUCCESS == status){
        System.out.println(filePath + " got sftp-ed successfully to  folder "+destFolder);
    }
    else if(FileTransferStatus.FAILURE == status){
        System.out.println("Fail to ssftp  to  folder "+destFolder);
    }
} catch (FileTransferException e) {
    e.printStackTrace();
}

堆棧跟蹤

Caused by: java.lang.NoClassDefFoundError: org/apache/commons/vfs/FileSystemException
    at com.zehon.sftp.SFTP.getSFTPClient(SFTP.java:20)
    at com.zehon.sftp.SFTP.sendFile(SFTP.java:50)
    at uploadFile(ftpService.java:208)

編輯:我將罐子包含在Eclipse項目外部庫中,我仍然收到相同的錯誤,我正在使用Maven

將commons-vfs-1.0.jar放入特定項目的類路徑中,並確保所有導入都在Java類中

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM