commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mayur malpani <mayur.p...@gmail.com>
Subject Re: [vfs] Facing issue while FTPing a file from Mainframe server using vfs -can someone help
Date Wed, 07 Apr 2010 10:22:51 GMT
Hi Tom/Ralph,
                        Thanks to both of you for you replies.
@ Tom i tried to run the code using the jar provided by you but i still get
the same exception file does not exist.

@ Ralph i enabled logging and following is the log o/p


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 it is a not a file.
 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)




Please find the following steps i have been using to fetch a file from a
Mainframe server ,so that it will give you guys a complete idea of how
exactly i m trying to do it.

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 thjis file but just for your reference lets
consider callings exists ( ) method on the src obj which should work fine
and return true

srcFileObj.exists()


---------------------------------------------------------------------------------------------------------------------------------------------------------------


   - can you think of where i am going wrong over here
   - If you have an example code that would give me a better understanding
   - Please let me know if I am going wrong somewhere over here.








On Wed, Apr 7, 2010 at 1:59 PM, Tom <tbee@tbee.org> wrote:

> Ok, how about like this:
>
> http://www.softworks.nl/stuff/kp-commons-vfs-2.0-20100331.175308-1.jar
>
>
>
>
> On 2010-04-07 10:14, mayur malpani wrote:
>
>> Hi Tom,
>>              I did not recieve any patch as an attached file.Can you
>> please
>> try to resend it ?
>>
>> Thanks,
>> Mayur.
>>
>> On Wed, Apr 7, 2010 at 1:05 PM, Tom<tbee@tbee.org>  wrote:
>>
>>
>>
>>> Here it is. I patched the usage of compound relative paths. Hope it
>>> helps.
>>>
>>> Tom
>>>
>>>
>>>
>>>
>>> On 2010-04-07 08:36, mayur malpani wrote:
>>>
>>>
>>>
>>>> Sure thanks Tom
>>>>
>>>> On Wed, Apr 7, 2010 at 12:04 PM, Tom<tbee@tbee.org>   wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> I'm going to drive to work and send you the file.
>>>>>
>>>>> Tom
>>>>>
>>>>>
>>>>>
>>>>> On 2010-04-07 08:32, mayur malpani wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hey Tom,
>>>>>>               That would be great if u can send the patch file .
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>> Mayur
>>>>>>
>>>>>> On Wed, Apr 7, 2010 at 10:53 AM, Tom<tbee@tbee.org>    wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> I found that VFS has problems when running against Alfresco's
FTP
>>>>>>> server
>>>>>>> and I had to patch VFS. Maybe this has a similar cause; I could
send
>>>>>>> you
>>>>>>> my
>>>>>>> VFS, see if that helps?
>>>>>>>
>>>>>>> Tom
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 2010-04-06 20:37, mayur malpani wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>      I am facing issues while FTPing a file from Mainframe
server to
>>>>>>>> unix
>>>>>>>> server using apache commons vfs ,but  it gives me a exception
saying
>>>>>>>> source
>>>>>>>> file cannot be found when i am trying to use the copyfrom
( )
>>>>>>>> function
>>>>>>>> .
>>>>>>>>
>>>>>>>> org.apache.commons.vfs.FileSystemException
>>>>>>>> : Could not copy ftp://host/file-name because it does not
exist.
>>>>>>>> at org.apache.commons.vfs.provider.AbstractFileObject.copyFrom(
>>>>>>>> AbstractFileObject.java:858)
>>>>>>>> at Testvfs.main(
>>>>>>>> Testvfs.java:102) .
>>>>>>>>
>>>>>>>> I am resolving the file using resolve( ) method .The url
i am using
>>>>>>>> is
>>>>>>>> "
>>>>>>>> ftp:\\<host name>\<file-name>       " . Once
i retrieve a
>>>>>>>> FTPFileObject
>>>>>>>> i
>>>>>>>> even
>>>>>>>> try to run FTPFileObject.fileExists( ) method and it returns
me
>>>>>>>> false
>>>>>>>> value.
>>>>>>>> I even confirmed that the file exist on the mainframe server.
>>>>>>>>
>>>>>>>>
>>>>>>>> The file from which i am trying to ftp is a mainframe server
and
>>>>>>>> copying
>>>>>>>> it
>>>>>>>> to unix server.
>>>>>>>>
>>>>>>>>
>>>>>>>> Can someone please help me out with this.
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Mayur.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>  ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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