Hi,

   +-From: "Paul Sabatino" <[email protected]> --
   |_Date: Fri, 7 Jan 2011 12:03:01 -0500 __________
   |
   |Our application is transferring  data via SCP on a channel and randomly
   |it will encounter the following error when transferring:
   ...
   |The application then attempts to get a new session using:
   |jsch.getSession(username, hostname, port);

   |It fails to reconnect with the following error (partial stack trace):
   |Caused by: com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 2 Protocol
   |error: expected packet SSH_MSG_USERAUTH_REQUEST, got SSH_MSG_CHANNEL_OPEN
   |                at com.jcraft.jsch.Session.read(Session.java:899)
   |                at com.jcraft.jsch.UserAuthNone.start(UserAuthNone.java:85)
   |                at com.jcraft.jsch.Session.connect(Session.java:350)

It seems to me that Session#connect() method has been re-invoked.  
Whenever establishing a new session, you need to get a new instance with  
  jsch.getSession(username, hostname, port);
and invoke its connect() method.

By the way, it seems the session is still alive,
because "SSH_MSG_CHANNEL_OPEN" has been returned.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
    +1-415-578-3454
Skype callto://jcraft/
Twitter: http://twitter.com/ymnk


------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to