[英]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.