commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mayur malpani <mayur.p...@gmail.com>
Subject [VFS] unable to resolve a file
Date Tue, 13 Apr 2010 15:12:42 GMT
Hi,
        I was working on sample app for FTPing a file from Mainframe(MVS)
system to anotherUnix system.I have followed the following steps .


1)  trying to construct an authenticator
private static StaticUserAuthenticator mainframeAuth = new
StaticUserAuthenticator(null, "username", "password");
----------------------------------------------------------------------------------------------------------------------------------------------------------
2)    trying to add filesystemOptions
    private static FileSystemOptions sourceOpts = new FileSystemOptions( );

DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(sourceOpts,
mainframeAuth );
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
3) Get a reference of source file object
srcMainframePath =
"ftp://[server-name]:21/\'[file.name]\'<ftp://[server-name]/\'[file.name]\'>
";
srcFileObj = (FtpFileObject) VFS.getManager().resolveFile(srcMainframePath,
sourceOpts);
---------------------------------------------------------------------------------------------------------------------------------------------------------------
4) Actually I am trying to copy this file but just for your reference lets
consider callings exists ( ) method on the src obj which should work fine
and return true but it is returning false
srcFileObj.exists()


But as I said I was trying to use destObj.copyFrom( srcObj) function , this
worked fine from Unix to Unix file transfer but when i run the same code to
copyFrom Mainframe server to Unix server it gave me the following exception
.I am still unable to trace out what is the exact issue ?Am I going wrong
somewhere here ?
Any thoughts from your side would help me a lot in getting this through.

 Exception :-  It says file does not exist but when i try to run the basic
FTP command from my local system i am able to copy the file  from Mainframe
to my syste

 2010/04/07 12:20:24:538 IST [INFO] DefaultFileReplicator - -Using
"C:\DOCUME~1\LOCALS~1\Temp\vfs_cache" as temporary files store.
2010/04/07 12:20:24:663 IST [DEBUG] StandardFileSystemManager - -Skipping
provider "org.apache.commons.vfs.provider.http.HttpFileProvider" because
required class "org.apache.commons.httpclient.HttpClient" is not available.
2010/04/07 12:20:24:663 IST [DEBUG] StandardFileSystemManager - -Skipping
provider "org.apache.commons.vfs.provider.https.HttpsFileProvider" because
required class "org.apache.commons.httpclient.HttpClient" is not available.
2010/04/07 12:20:24:663 IST [DEBUG] StandardFileSystemManager - -Skipping
provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider" because
required class "com.jcraft.jsch.JSch" is not available.
2010/04/07 12:20:25:616 IST [DEBUG] SoftRefFilesCache - -putFile:
ftp://[src-server-name]/[file-name]
2010/04/07 12:20:25:616 IST [DEBUG] SoftRefFilesCache - -putFile:
ftp://[src-server-name]/

2010/04/07 12:20:30:835 IST [DEBUG] SoftRefFilesCache - -putFile:
ftp://[servername]/[absolute file path]/[dest-file-name]
2010/04/07 12:20:30:835 IST [DEBUG] SoftRefFilesCache - -putFile:
ftp://[servername]/
2010/04/07 12:20:30:835 IST [DEBUG] SoftRefFilesCache - -putFile:
ftp://[servername]/[absolute file path]
2010/04/07 12:20:30:851 IST [DEBUG] SoftRefFilesCache - -putFile:
ftp://[servername]/[absolute file path]
2010/04/07 12:20:30:851 IST [DEBUG] SoftRefFilesCache - -putFile:
ftp://[servername]/[absolute file path]
2010/04/07 12:20:30:851 IST [DEBUG] SoftRefFilesCache - -putFile:
ftp://[servername]/[absolute file path]
2010/04/07 12:20:30:851 IST [DEBUG] SoftRefFilesCache - -putFile:
ftp://[servername]/[absolute file path]
2010/04/07 12:20:30:851 IST [DEBUG] SoftRefFilesCache - -putFile:
ftp://[servername]/[absolute file path]
org.apache.commons.vfs.FileSystemException: Could not read from "
*ftp://[src-server-name]/[file-name] because file
ftp://[src-server-name]/[file-name] does not exist at*
org.apache.commons.vfs.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1109)
 at
org.apache.commons.vfs.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:317)
 at org.apache.commons.vfs.FileUtil.writeContent(FileUtil.java:71)
 at org.apache.commons.vfs.FileUtil.copyContent(FileUtil.java:103)
 at Testvfs.main(Testvfs.java:110)





Thanks
Mayur.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message