[VFS] problem on runtime connection to SFTp server

classic Classic list List threaded Threaded
10 messages Options
lmk
Reply | Threaded
Open this post in threaded view
|

[VFS] problem on runtime connection to SFTp server

lmk
Hi all,

Im using VFS to  get SFTP files, when I try to get files on the main methode, it works, but when, calling the same method with the same parameters  on tomcat 5.5 web app does not work.
I get the exception .;:

java.lang.RuntimeException: SFTP error parsing path /myFolder.
Caused by: org.apache.commons.vfs.FileSystemException: Could not connect to SFTP server at "hostname".


any ideas about this issue.

thanks by advance.
lmk
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] problem on runtime connection to SFTp server

lmk
Im using a DefaultFileSystemManager
the exception occured on : dfsManager.resolveFile(path, fsop);

Best regards!

lmk wrote
Hi all,

Im using VFS to  get SFTP files, when I try to get files on the main methode, it works, but when, calling the same method with the same parameters  on tomcat 5.5 web app does not work.
I get the exception .;:

java.lang.RuntimeException: SFTP error parsing path /myFolder.
Caused by: org.apache.commons.vfs.FileSystemException: Could not connect to SFTP server at "hostname".


any ideas about this issue.

thanks by advance.
lmk
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] problem on runtime connection to SFTp server

lmk
In reply to this post by lmk
I get a strange problem,

the first time I try to  get files it works, the second one, it does not work. same directoty, same login...

lmk wrote
Hi all,

Im using VFS to  get SFTP files, when I try to get files on the main methode, it works, but when, calling the same method with the same parameters  on tomcat 5.5 web app does not work.
I get the exception .;:

java.lang.RuntimeException: SFTP error parsing path /myFolder.
Caused by: org.apache.commons.vfs.FileSystemException: Could not connect to SFTP server at "hostname".


any ideas about this issue.

thanks by advance.
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] problem on runtime connection to SFTp server

Sergey Vladimirov
Hi, lmk.

Can you provide full stack trace of exception, please?

--
Sergey Vladimirov

On Tue, Mar 24, 2009 at 12:09 PM, lmk <[hidden email]> wrote:

>
> I get a strange problem,
>
> the first time I try to  get files it works, the second one, it does not
> work. same directoty, same login...
>
>
> lmk wrote:
>>
>> Hi all,
>>
>> Im using VFS to  get SFTP files, when I try to get files on the main
>> methode, it works, but when, calling the same method with the same
>> parameters  on tomcat 5.5 web app does not work.
>> I get the exception .;:
>>
>> java.lang.RuntimeException: SFTP error parsing path /myFolder.
>> Caused by: org.apache.commons.vfs.FileSystemException: Could not connect
>> to SFTP server at "hostname".
>>
>> any ideas about this issue.
>>
>> thanks by advance.
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-VFS--problem-on-runtime-connection-to-SFTp-server-tp22664327p22676419.html
> Sent from the Commons - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

lmk
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] problem on runtime connection to SFTp server

lmk
Hi Sergey,

here the exception trace

org.apache.commons.vfs.FileSystemException: Unknown scheme "sftp" in URI "sftp://login:password@host/path/".


detailMessage=vfs.impl/unknown-scheme.error


regards!


Sergey Vladimirov wrote
Hi, lmk.

Can you provide full stack trace of exception, please?

--
Sergey Vladimirov

On Tue, Mar 24, 2009 at 12:09 PM, lmk <lotfi65@yahoo.fr> wrote:
>
> I get a strange problem,
>
> the first time I try to  get files it works, the second one, it does not
> work. same directoty, same login...
>
>
> lmk wrote:
>>
>> Hi all,
>>
>> Im using VFS to  get SFTP files, when I try to get files on the main
>> methode, it works, but when, calling the same method with the same
>> parameters  on tomcat 5.5 web app does not work.
>> I get the exception .;:
>>
>> java.lang.RuntimeException: SFTP error parsing path /myFolder.
>> Caused by: org.apache.commons.vfs.FileSystemException: Could not connect
>> to SFTP server at "hostname".
>>
>> any ideas about this issue.
>>
>> thanks by advance.
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-VFS--problem-on-runtime-connection-to-SFTp-server-tp22664327p22676419.html
> Sent from the Commons - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] problem on runtime connection to SFTp server

Jörg Schaible
lmk wrote at Dienstag, 24. März 2009 14:58:

>
> Hi Sergey,
>
> here the exception trace
>
> org.apache.commons.vfs.FileSystemException: Unknown scheme "sftp" in URI
> "sftp://login:password@host/path/".

This is an error message, but not a stack trace. However, it seems that you
do not have commons-net and jsch in your deps ...

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

lmk
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] problem on runtime connection to SFTp server

lmk
I have
 commons-net-2.0
commons-vfs-1.0
jsch-0.1.40


the first call works..but the second  one does not.



Jörg Schaible-2 wrote
lmk wrote at Dienstag, 24. März 2009 14:58:

>
> Hi Sergey,
>
> here the exception trace
>
> org.apache.commons.vfs.FileSystemException: Unknown scheme "sftp" in URI
> "sftp://login:password@host/path/".

This is an error message, but not a stack trace. However, it seems that you
do not have commons-net and jsch in your deps ...

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
lmk
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] problem on runtime connection to SFTp server

lmk
It seems that the problem comes from release function, when I call It after  copying files, the second SFTP connection fail.

here the release method code:

public void release() {
                this.fsManager.close();

        } // release()


lmk wrote
I have
 commons-net-2.0
commons-vfs-1.0
jsch-0.1.40


the first call works..but the second  one does not.



Jörg Schaible-2 wrote
lmk wrote at Dienstag, 24. März 2009 14:58:

>
> Hi Sergey,
>
> here the exception trace
>
> org.apache.commons.vfs.FileSystemException: Unknown scheme "sftp" in URI
> "sftp://login:password@host/path/".

This is an error message, but not a stack trace. However, it seems that you
do not have commons-net and jsch in your deps ...

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
tlc
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] problem on runtime connection to SFTp server

tlc

I have similar problem.  The call to 'resolveFile' failed with 'Unknown scheme "sftp"' error on the second operation.  I found couple things:

1) URL is of form sftp://user:pass@host/remotepath/ does not work on Tomcat.  I had to change to using the below to authenticate:
StaticUserAuthenticator auth = new StaticUserAuthenticator(null, "username", "password");
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);

2) fsManager.close() between operations causes the error.  You need to remove this and close it only once when the whole process completes.

lmk wrote
It seems that the problem comes from release function, when I call It after  copying files, the second SFTP connection fail.

here the release method code:

public void release() {
                this.fsManager.close();

        } // release()


lmk wrote
I have
 commons-net-2.0
commons-vfs-1.0
jsch-0.1.40


the first call works..but the second  one does not.



Jörg Schaible-2 wrote
lmk wrote at Dienstag, 24. März 2009 14:58:

>
> Hi Sergey,
>
> here the exception trace
>
> org.apache.commons.vfs.FileSystemException: Unknown scheme "sftp" in URI
> "sftp://login:password@host/path/".

This is an error message, but not a stack trace. However, it seems that you
do not have commons-net and jsch in your deps ...

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] problem on runtime connection to SFTp server

Ken Tanaka
If you need to call release() (and reinitialize) between processing operations I recommend you use a release method like this:

    public void release() {
        FileSystem fs = null;

        fs = this.src.getFileSystem(); // This works even if the src is closed.
        this.fsManager.closeFileSystem(fs);
    }

In order for this release() to work, your class will need to have a

    private FileObject src = null; // used for cleanup in release()

and some time after setting

    children = this.sftpFile.getChildren();

you should

    // Set src for cleanup in release()

    src = children[0];

There is an example in the wiki at
http://wiki.apache.org/jakarta-commons/SimpleSftpFileDownload

tlc wrote:

> I have similar problem.  The call to 'resolveFile' failed with 'Unknown
> scheme "sftp"' error on the second operation.  I found couple things:
>
> 1) URL is of form sftp://user:pass@host/remotepath/ does not work on Tomcat.
> I had to change to using the below to authenticate:
> StaticUserAuthenticator auth = new StaticUserAuthenticator(null, "username",
> "password");
> DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts,
> auth);
>
> 2) fsManager.close() between operations causes the error.  You need to
> remove this and close it only once when the whole process completes.
>
>
> lmk wrote:
>  
>> It seems that the problem comes from release function, when I call It
>> after  copying files, the second SFTP connection fail.
>>
>> here the release method code:
>>
>> public void release() {
>> this.fsManager.close();
>>
>> } // release()
>>
>>
>>
>> lmk wrote:
>>    
>>> I have
>>>  commons-net-2.0
>>> commons-vfs-1.0
>>> jsch-0.1.40
>>>
>>>
>>> the first call works..but the second  one does not.
>>>
>>>
>>>
>>>
>>> Jörg Schaible-2 wrote:
>>>      
>>>> lmk wrote at Dienstag, 24. März 2009 14:58:
>>>>
>>>>        
>>>>> Hi Sergey,
>>>>>
>>>>> here the exception trace
>>>>>
>>>>> org.apache.commons.vfs.FileSystemException: Unknown scheme "sftp" in
>>>>> URI
>>>>> "sftp://login:password@host/path/".
>>>>>          
>>>> This is an error message, but not a stack trace. However, it seems that
>>>> you
>>>> do not have commons-net and jsch in your deps ...
>>>>
>>>> - Jörg
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>
>>>>        
>>>      
>>    
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]