commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Marshall (JIRA)" <>
Subject [jira] Commented: (VFS-201) FTP is failing by saying "File doesn't exist" even the file exists and a valid file.
Date Sun, 30 Mar 2008 20:18:24 GMT


Alex Marshall commented on VFS-201:

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 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)

> FTP is failing by saying "File doesn't exist" even the file exists and a valid file.
> ------------------------------------------------------------------------------------
>                 Key: VFS-201
>                 URL:
>             Project: Commons VFS
>          Issue Type: Bug
>         Environment: Linux
>            Reporter: Satish Kumar Kommuri
> Hi,
> We are facing a strange problem with vfs file transfer from one of the FTP locations.
Java code throws the FileSystemException by saying "<particular file> does not exist".
On the other hand, FTP to that site and wget are working.
> Moreover, from the same machine we are able to FTP from the command line and able to
download the file using get command.
> And also, wget works fine. No idea the same is failing from java.
> Please find the code snippent below:
>  FileSystemOptions fso = new FileSystemOptions();
>  SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fso, "no");
>  FileObject sourceFileObject = fsm.resolveFile(sourceUri, fso);
>  String sourceFilePath = sourceFileObject.getName().getPath();
>  FileObject targetFileObject = fsm.resolveFile(targetUri, fso);
> FileObject tfo = targetFileObject;
> if(tfo.getType() == FileType.FOLDER)
> 	tfo = targetFileObject.resolveFile(sourceFileObject.getName().getBaseName());
>"The URI is a file");
>"Remote Path: [" + sourceFileObject.getName().getPath() + "] Local
Path: [" + tfo.getName().getPath() + "]");
> 	copyFile(sourceFileObject, tfo);
> copyFrom method:
>  private void copyFile(FileObject sourceFileObject, FileObject targetFileObject) 
> 	 {		
> 			targetFileObject.copyFrom(sourceFileObject, new AllFileSelector()); 
> 			copiedFiles.add(sourceFileObject.getName().getPath());
> 		} catch (FileSystemException e) 
> 		{
> 			failedFiles.add(sourceFileObject.getName().getPath());
> 			failedFileExceptions.add(e);
> 			LOGGER.error("Exception in FileTransferAgent:copyFile "+e);
> 		}
> 	 }
> exception is:
> Exception in FileTransferAgent:copyFile org.apache.commons.vfs.FileSystemException: Could
not copy "ftp://usename:password@ipaddress/home/blrproj/console.out" because it does not exist.
> org.apache.commons.vfs.FileSystemException: Could not copy "ftp://usename:password@ipaddress/home/blrproj/console.out"
because it does not exist.
>         at org.apache.commons.vfs.provider.AbstractFileObject.copyFrom(
>         at FileTransferAgent.copyFile(
>         at FileTransferAgent.copyFiles(
>         at FileTransferAgent.main(

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message