shikhar/sshj — Issue #57: Initializing SFTP raises exception
Author: haydarekarrar
Created: 2012-01-31 09:05:47+00:00
State: open

When trying to initialize a SFTP connection I get an exception.

SSHClient ssh = new SSHClient();
ssh.addHostKeyVerifier("someverifier");
ssh.loadKnownHosts();
ssh.connect(FTP_ADDRESS);
ssh.authPassword(FTP_USER, FTP_PWD);

SFTPClient sftp = ssh.newSFTPClient();
sftp.mkdir(FTP_REMOTE_DIR);

[code]
java.lang.RuntimeException: Invalid value: -1
at net.schmizz.sshj.common.Buffer.putUInt32(Buffer.java:329)
at net.schmizz.sshj.connection.channel.ChannelOutputStream$DataBuffer.flush(ChannelOutputStream.java:118)
at net.schmizz.sshj.connection.channel.ChannelOutputStream$DataBuffer.flush(ChannelOutputStream.java:98)
at net.schmizz.sshj.connection.channel.ChannelOutputStream.flush(ChannelOutputStream.java:209)
at net.schmizz.sshj.sftp.SFTPEngine.transmit(SFTPEngine.java:262)
at net.schmizz.sshj.sftp.SFTPEngine.init(SFTPEngine.java:69)
at net.schmizz.sshj.SSHClient.newSFTPClient(SSHClient.java:623)
[/code]