Knowledgebase
SshTaskTimeoutException: Exceeded task timeout; when using sshSession.send(command);
Posted by - NA - on 28 April 2010 09:04 AM
This exception might arise when the shell prompt and the command line terminator is not set according to the server used. By default the shell prompt is set to "$" and the command line terminator is set to "/n". Suppose you are using a Windows server the shell prompt needs to be ">" and the command terminator can be "/r/n". To change these values call the setShellPrompt method and setCommandTerminator method before calling sshSession.connect().

For example,

SshParameters params = new SshParameters(ftpHostname,ftpUsername,ftpPassword);
SshSession sshSession = new SshSession(params);

sshSession.setShellPrompt(">"); //Windows
sshSession.setCommandTerminator("\r\n");

sshSession.connect();
String result = sshSession.send(command);
sshSession.disconnect();
(99 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako fusion