When you are using 1 connection, in order to multiple transfers, than for each transfer I use a new openSftpChannel. Allthough I explicitly close this channel, the 1oth attempth fails, giving an exception: "The SFTP subsystem failed to start"
Thorough debugging and code-analysys lead to my conclusion that the session-leak is inside the j2ssh jar file, and especially in the function openSftpChannel:
public SftpSubsystemClient openSftpChannel(
ChannelEventListener eventListener) throws IOException {
SessionChannelClient session = openSessionChannel(eventListener);
SftpSubsystemClient sftp = new SftpSubsystemClient();
if (!openChannel(sftp)) {
throw new SshException("The SFTP subsystem failed to start");
}
// Initialize SFTP
if (!sftp.initialize()) {
throw new SshException(
"The SFTP Subsystem could not be initialized");
}
return sftp;
}
Wjen I remove the line "SessionChannelClient session = openSessionChannel(eventListener);", rebuild and rerun my application, everything works perfect.
Logged In: YES
user_id=2176661
Originator: NO
Hi, I don't know if the my case can have any kind of relation, but I have the same problem while trying to open an SFTP connection to an Axway Gateway.
It I don't remove the line "SessionChannelClient session = openSessionChannel(eventListener);" into openSftpChannel I do get the exception: "The SFTP subsystem failed to start". The strangest thing is that I don't get any kind of error if I try to connect to a normal OpenSSH server. Maybe, in my case, the problem deals with the Axway gateway which is not able to work with multiple channels?