当我尝试使用 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/