commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oded Blayer" <Oded.Bla...@invoke.com>
Subject RE: [VFS] sftp problems
Date Thu, 06 Nov 2003 12:46:12 GMT
Hi.
I am evaluating VFS as well, although I don't evaluate the SFTP provider.
Maybe the answer is to close the FileSystemManager by casting it to the DefaultFileSystemManager
(I think this is the only FileSystemManager in use).

That is just a wild guess, because I know the VFS project is not developed anymore.

Oded Blayer
Software Engineer
Invoke Solutions

-----Original Message-----
From: Morus Walter [mailto:morus.walter@tanto-xipolis.de]
Sent: Thursday, November 06, 2003 2:18 PM
To: commons-user@jakarta.apache.org
Subject: [VFS] sftp problems


Hi,

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

First:
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/" );

	System.out.println(ftpDir.exists());

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

	for ( int i=0; i < list.length; i++ ) {
	    System.out.println(list[i].getName().getBaseName());
	}
	System.out.println("\nDONE\n");
    }
}

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 (Object.java:429)
  [3] java.lang.ref.Reference$ReferenceHandler.run (Reference.java:115)
and a 'where' in the finalizer
Finalizer[1] where
  [1] java.lang.Object.wait (native method)
  [2] java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:111)
  [3] java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:127)
  [4] java.lang.ref.Finalizer$FinalizerThread.run (Finalizer.java:159)

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

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

Second:
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
entries.
But the http://www.jcraft.com/jsch/ 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?


TIA
    Morus

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


Mime
View raw message