You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by José Luis Núñez <jo...@compuarte.net.mx> on 2006/10/28 21:10:40 UTC
vfs sftp fails restablishing the connection after sftp server restart service
I am developing an application for monitoring a local folder, when a file
was changed or added this is transfered to another box via sftp or ftp
Monitoring routines of vfs works fine, ftp also, sftp while the other box is
alive has not problem, but if the other box is down when monitor trigger the
event after remote box is restablished all subsecuent transfers abort with
error.
If instead of sftp we did the same process with ftp, vfs restablish the
connection succesfuly
Any idea?
SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(opts,"no"
);
SftpFileSystemConfigBuilder.getInstance().setTimeout(opts,1000);
manager = VFS.getManager();
quearchivo = fileobject.getURL().toString();
fileobject = manager.resolveFile(fileobjectStringURL,opts);
if (fileobject.exists()){ <--- Here throws error
...
...
Caused by: com.jcraft.jsch.JSchException: session is down
at com.jcraft.jsch.Session.openChannel(Session.java:641)
at
org.apache.commons.vfs.provider.sftp.SftpFileSystem.getChannel(SftpFileSyste
m.java:121)
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
RE: vfs sftp fails restablishing the connection after sftp server restart service
Posted by José Luis <jn...@compuarte.com.mx>.
Thanks a lot, the problem was that my try sequence was wrong
I had
try{ ...
} catch (FileSystemException e){
...
} catch (IOException e) {
...
}
When the system lose sftp connection first catch the FileSystemException but
the critical exception really was IOException, everything works fine after
reorder the sequence
try{ ...
} catch (IOException e) {
...
} catch (FileSystemException e){
...
}
-----Mensaje original-----
De: Mario Ivankovits [mailto:mario@ops.co.at]
Enviado el: Martes, 31 de Octubre de 2006 01:52 a.m.
Para: Jakarta Commons Users List
Asunto: Re: vfs sftp fails restablishing the connection after sftp server
restart service
Hi José!
> If instead of sftp we did the same process with ftp, vfs restablish
> the connection succesfuly
>
Hmmm .... looks like there is no reestablishing connection stuff in sftp
- or its broken.
Please open a jira ticket at http://issues.apache.org/jira, I'll have a look
at it then, though, might take some time as I am on vacation for the next
couple of days :-)
Thanks!
Ciao,
Mario
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: vfs sftp fails restablishing the connection after sftp server
restart service
Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi José!
> If instead of sftp we did the same process with ftp, vfs restablish the
> connection succesfuly
>
Hmmm .... looks like there is no reestablishing connection stuff in sftp
- or its broken.
Please open a jira ticket at http://issues.apache.org/jira, I'll have a
look at it then, though, might take some time as I am on vacation for
the next couple of days :-)
Thanks!
Ciao,
Mario
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org