commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <>
Subject [VFS] sftp problems
Date Thu, 06 Nov 2003 12:18:25 GMT

we're currently evaluating the VFS library basically for ftp and sftp use.
I have two problems with sftp file access:

I wrote a little sample programm displaying the list of files in a
remote direcory:
class VfsTest
    public static void main(String argc[]) throws Exception {

	FileSystemManager fsManager = VFS.getManager();
	FileObject ftpDir = fsManager.resolveFile( "sftp://xipolis:xxx@hostname/home/xipolis/" );


	FileObject list[] = ftpDir.findFiles(new FileDepthSelector(0,1));

	for ( int i=0; i < list.length; i++ ) {

While this works in principle, the programm does not terminate afterwards.
It just hangs.
I had a look at it using the debugger and I see
> threads
Group system:
  (java.lang.ref.Reference$ReferenceHandler)0x368 Reference Handler cond. waiting
  (java.lang.ref.Finalizer$FinalizerThread)0x369  Finalizer         cond. waiting
  (java.lang.Thread)0x36a                         Signal Dispatcher running
Group main:
  (java.lang.Thread)0x36c                         Thread-0          running
  (java.lang.Thread)0x36d                         DestroyJavaVM     running
> thread 0x368

but I don't know how to find out, what the finalizer and the reference handler
are waiting for.
A 'where' in the reference handler just shows
Reference Handler[1] where
  [1] java.lang.Object.wait (native method)
  [2] java.lang.Object.wait (
  [3] java.lang.ref.Reference$ (
and a 'where' in the finalizer
Finalizer[1] where
  [1] java.lang.Object.wait (native method)
  [2] java.lang.ref.ReferenceQueue.remove (
  [3] java.lang.ref.ReferenceQueue.remove (
  [4] java.lang.ref.Finalizer$ (

The situation is unchanged if I call close() for all FileObjects and
I didn't see any other methods, that might have to be called for cleaning

Can anyone help me with this problem?
Am I missing something or is this a bug in the sftp handler?
Other protocols work fine.

While some connections work, I get exceptions for others.
VFS is claiming that it could not connect to the SFTP server, which is
caused by com.jcraft.jsch.JSchException: UnknownHostKey

However the host is in my .ssh/known_hosts.

As far as I've seen yet, the only difference is, that the working hosts
have an entry of type ssh-dss whereas the ones that don't work have ssh-rsa
But the says
 Host key type: ssh-dss,ssh-rsa
and a colleague reports that it's working for him even with a ssh-rsa key.

Has anyone had such a problem? Any hint what I might be doing wrong?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message