|
Hi,
we were facing the same "<particular file> does not exist" problem last Friday (the 29. of February). After tracing the Problem for quite a while we figured out the problem was caused by the intercalary day. The Apache-FTP-Code tries to parse the target/source-File Date on the FTP site and can't cope with the 29.02 returning a "null" instead of a Fileobject and thus returning a "file not found". I think this Problem even occurs if any of the root-directories got a timestamp on that day. Hope we get a fix within the next 4 years Regards Oliver Adding to the problem,
The same code works fine from one machine and doesn't work from another. Even though both are Linux machines. Don't know where it is going wrong. Could you please suggest which and all parameters to be verified and corrected in a machine to make this work. Hello,
I'm facing this exact same problem : FileSystemManager manager = VFS.getManager(); FtpFileSystemConfigBuilder.getInstance().setPassiveMode(options, true); FileObject file = manager.resolveFile("ftp://myusername:mypassword@myip:21/test.txt", options); InputStream fileStream = file.getContent().getInputStream(); IOUtils.copy(fileStream, System.out); file.close(); ...and the exception I get is : ...even though I can open up an FTP client, log in, and verify that the file 'test.txt' is in fact in the root of the FTP after log in. Are you guys facing this problem with symbolic links? I opened another issue which addresses symbolic links that it says is not a file.
No, I'm not facing this problem with symlinks.
Actually, after spending the last several hours debugging in Eclipse, I traced the problem down to my server not being correctly configured to enable passive mode. As a result, I'm able to successfully log in, but when org.apache.commons.net.ftp.FTPClient.pasv() is called internally by the FTPClient which is used by the FTP module of commons VFS, it does not properly handle the return code for 500 Invalid command in response to attempting to get the FTP server to change to passive mode. This was after testing for active mode within the Commons NET FTP client. To my mind, this code should fallback to active mode if it can't connect in passive. I was able to remedy my situation by changing the FileSystemOptions I was using and forcefully disabling passive mode, ie FtpFileSystemConfigBuilder.sePassiveMode(opt, false) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fso, "no");
and connecting to an FTP server:
"ftp://usename:password@ipaddress/home/blrproj/console.out"
... if your intention is to connect to an SFTP server, try:
"sftp://usename:password@ipaddress/home/blrproj/console.out".