Hi,

   +-From: Boris Klug <[email protected]> --
   |_Date: Mon, 15 Jun 2009 13:02:53 +0200 ____
   |
   |We user jsch to submit commands to Linux and AIX machines - and also get 
   |  NPEs from time to time. I am not shure if it is the same problem, but 
   |it would be gigantic if our problems were solved with this fix too.

Can you try the following patch?

--- com/jcraft/jsch/Request.java    (revision 1979)
+++ com/jcraft/jsch/Request.java    (working copy)
@@ -47,6 +47,8 @@
       channel.reply=-1;
     }
     session.write(packet);
+    IO iorequest2 = channel.io; // in some case, IO is set to null
+
     if(reply){
       long start=System.currentTimeMillis();
       long timeout=channel.connectTimeout;
@@ -54,6 +56,8 @@
      try{Thread.sleep(10);}
      catch(Exception ee){
      }
+     channel.io = iorequest2;  // in some case, IO is set to null
+
         if(timeout>0L &&
            (System.currentTimeMillis()-start)>timeout){
           channel.reply=0;

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to