java - apache-commons-net 中的 DebugException

标签 java apache-commons-net

当我尝试使用 ftpClient.listFiles("folder"); 列出我所在位置的文件时,它显示

org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array.

有人可以指导我我做错了什么吗?

我使用apache-commons-net-3.3

我的代码是

FTPClientConfig ftpClientConfig = new FTPClientConfig(FTPClientConfig.SYST_NT);
FTPClient ftpClient = new FTPClient();
ftpClient.configure(ftpClientConfig);
ftpClient.connect(hostName, Integer.valueOf(portNumber));
ftpClient.enterLocalPassiveMode();
ftpClient.login(username, password);

// Error throws here
FTPFile[] files = ftpClient.listFiles("folder");

最佳答案

当用户提供错误或加密的用户名或密码时,会引发此异常。

Apache 没有抛出正确的异常。

关于java - apache-commons-net 中的 DebugException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26376734/

相关文章:

java - 无法使用 Apache commons-net-3.1 在 FTP 上上传大文件

java - 奇怪的 FTPClient.storeFile 行为

java - 为 Ruby 编写 C 扩展的好处

java - 在另一个构造函数中使用 "this"

java - 如何在Java上检索显卡信息?

java - FTPClient - Java,上传文件

Java + Apache Commons Net : Read FTPFile Without Downloading

java.lang.NoSuchMethodError : javax. servlet.ServletContext.getVirtualServerName()Ljava/lang/String;

Java - TCP套接字仅在LAN中连接

ftp - 使用 Apache FtpClient 计算 FTP 服务器中的文件校验和