SSH2 Ganymade异常ch.ethz.ssh2.channel.ChannelClosedException:SSH通道已关闭

问题描述

我正在使用juniper-netconf连接到使用juniper netconf-1.0.1的交换机。提取接口时,出现“ ch.ethz.ssh2.channel.ChannelClosedException:SSH通道已关闭”异常。 是什么原因造成的?

class ConnectionWrapper {
 Device device=null;
ConnectionWrapper(String hostName,String username,String password) throws Exception{
Device device = Device.builder().hostName(hostName).userName(username).password(password)
   .timeout(* 1000).port(22).build();
device.connect();
this.device=device;
}
// getting exception from here
public XML execute(String command) throws Exception {
  return device.executeRPC(command);
}

public void close() throws Exception {
         device.close();
}
}

    //calling from another class
  ConnectionWrapper connection = new ConnectionWrapper(host,username,password);
   ConnectionWrapper.execute("get-interface-information");

ch.ethz.ssh2.channel.ChannelClosedException:SSH通道已关闭。 (连接正在关闭) 在ch.ethz.ssh2.channel.ChannelManager.sendData(ChannelManager.java:387) 在ch.ethz.ssh2.channel.ChannelOutputStream.write(ChannelOutputStream.java:71) 在ch.ethz.ssh2.channel.ChannelOutputStream.write(ChannelOutputStream.java:77)在net.juniper.netconf.NetconfSession.getRpcReply(NetconfSession.java:82) 在net.juniper.netconf.NetconfSession.executeRPC(NetconfSession.java:219) 在net.juniper.netconf.Device.executeRPC(Device.java:530)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...