You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by lmk <lo...@yahoo.fr> on 2009/03/23 18:38:21 UTC

[VFS] problem on runtime connection to SFTp server

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-tp22664327p22664327.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


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

Posted by lmk <lo...@yahoo.fr>.
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.
> 
> 

-- 
View this message in context: http://www.nabble.com/-VFS--problem-on-runtime-connection-to-SFTp-server-tp22664327p22666013.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


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

Posted by Ken Tanaka <Ke...@noaa.gov>.
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: 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


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

Posted by tlc <th...@yahoo.com>.

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

-- 
View this message in context: http://www.nabble.com/-VFS--problem-on-runtime-connection-to-SFTp-server-tp22664327p26086652.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


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

Posted by lmk <lo...@yahoo.fr>.
It seems that the problem comes from release function, when I call It after 
copying files, the second SFTP connection fail.


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

-- 
View this message in context: http://www.nabble.com/-VFS--problem-on-runtime-connection-to-SFTp-server-tp22664327p22718714.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


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

Posted by lmk <lo...@yahoo.fr>.
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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-VFS--problem-on-runtime-connection-to-SFTp-server-tp22664327p22681716.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


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

Posted by Jörg Schaible <jo...@gmx.de>.
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


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

Posted by lmk <lo...@yahoo.fr>.
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 <lo...@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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-VFS--problem-on-runtime-connection-to-SFTp-server-tp22664327p22681000.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


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

Posted by Sergey Vladimirov <vl...@gmail.com>.
Hi, lmk.

Can you provide full stack trace of exception, please?

-- 
Sergey Vladimirov

On Tue, Mar 24, 2009 at 12:09 PM, lmk <lo...@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


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

Posted by lmk <lo...@yahoo.fr>.
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