[JSch-users] java.lang.OutOfMemoryError
Status: Alpha
Brought to you by:
ymnk
From: Biju J. <bij...@ho...> - 2003-09-18 14:39:15
|
Hi, I am using Jcraft Jsh to connect to SHH2 Server, I am getting java.lang.OutofMemoryError. The trace stack does not give me anything other than this error message. Below is the code which I am using to connect. I was able to connect to the SSH2 server using other tool using similar code. ------------------------------------- import com.jcraft.jsch.*; import com.jcraft.jsch.JSch; import com.jcraft.jsch.Session; import com.sshtools.j2ssh.SshClient; import com.sshtools.j2ssh.transport.IgnoreHostKeyVerification; import com.sshtools.j2ssh.transport.publickey.InvalidSshKeyException; import com.sshtools.j2ssh.transport.publickey.SshPrivateKeyFile; import com.sshtools.j2ssh.authentication.AuthenticationProtocolState; import com.sshtools.j2ssh.authentication.PublicKeyAuthenticationClient; import sun.security.krb5.internal.crypto.j; import org.apache.log4j.Logger; import java.io.File; import java.io.IOException; public class SSHConnection { private static Logger logger = Logger.getLogger(SSHConnection.class); boolean connectState = false; public boolean createConnection(String Host) throws IOException{ try { // Make a client connection SshClient JSch jsch=new JSch(); //SshClient ssh = new SshClient(); System.out.println("The value of Host is:"+Host); // Connect to the host // ssh.connect(Host, new IgnoreHostKeyVerification()); // Open up the private key file File HostkeyFile = new File("C:\\downloads\\j2ssh-0.2.4\\bin\\teamskey"); if (HostkeyFile.exists()) logger.debug("createConnection():The file present"); jsch.addIdentity(HostkeyFile.getAbsolutePath()); logger.debug("createConnection():The Host Key file is" +HostkeyFile.getAbsolutePath()); // Session session=jsch.getSession("tstuser", Host); logger.debug("The Host Name is : " + Host); java.util.Properties config=new java.util.Properties(); config.put("StrictHostKeyChecking", "no"); ConnectionUserInfo ui=new ConnectionUserInfo(); logger.debug("The Conenction Userifo: " ); session.setConfig(config); session.setUserInfo(ui); logger.debug("User info Set : " ); session.connect(); logger.debug("Session.connect(): " ); connectState = session.isConnected(); Channel channel=session.openChannel("shell"); channel.setInputStream(System.in); channel.setOutputStream(System.out); channel.connect(); return connectState; // System.out.println(" System authenticated"); } catch(JSchException Jsche) { Jsche.printStackTrace(); return connectState; } } } ------END--------------- When I debug this code , this error is happening after the session is authenticated in session.connect() Though I am not able to pinpont what the error is. I am using a Junit test case to test this. -Thanks BK _________________________________________________________________ Use custom emotions -- try MSN Messenger 6.0! http://www.msnmessenger-download.com/tracking/reach_emoticon |