简体   繁体   English

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

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

An odd thing happened after I followed sample code from here 从这里开始遵循示例代码后,发生了一件奇怪的事情

Code

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();
}

Stacktrace 堆栈跟踪

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)

EDIT: I included the jar in the Eclipse project external libraries and I still get the same error also, I am using Maven 编辑:我将罐子包含在Eclipse项目外部库中,我仍然收到相同的错误,我正在使用Maven

将commons-vfs-1.0.jar放入特定项目的类路径中,并确保所有导入都在Java类中

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.NoClassDefFoundError:org / apache / commons / vfs / FileSelector - java.lang.NoClassDefFoundError: org/apache/commons/vfs/FileSelector java.lang.NoClassDefFoundError:org / apache / commons / lang3 / ObjectUtils - java.lang.NoClassDefFoundError: org/apache/commons/lang3/ObjectUtils java.lang.NoClassDefFoundError:org / apache / commons / lang / text / StrLookup - java.lang.NoClassDefFoundError: org/apache/commons/lang/text/StrLookup java.lang.NoClassDefFoundError: org/apache/commons/lang/builder/CompareToBuilder - java.lang.NoClassDefFoundError: org/apache/commons/lang/builder/CompareToBuilder java.lang.NoClassDefFoundError:org.apache.commons.lang3.ArrayUtils - java.lang.NoClassDefFoundError: org.apache.commons.lang3.ArrayUtils java.lang.NoClassDefFoundError:org / apache / commons / lang / Validate - java.lang.NoClassDefFoundError: org/apache/commons/lang/Validate java.lang.NoClassDefFoundError:org / apache / commons / collections / ReferenceMap - java.lang.NoClassDefFoundError: org/apache/commons/collections/ReferenceMap 错误-java.lang.NoClassDefFoundError:org / apache / commons / logging / LogFactory - Error -java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory java.lang.NoClassDefFoundError:org / apache / commons / discovery / tools / DiscoverSingleton - java.lang.NoClassDefFoundError: org/apache/commons/discovery/tools/DiscoverSingleton java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory - java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM