Java 使用JSCH API连接远程主机时发生NoClassDefFoundError

Java 使用JSCH API连接远程主机时发生NoClassDefFoundError,java,jsch,Java,Jsch,我正在进行一个项目,在这个项目中,我需要连接到远程AIX主机,以使用JSCHAPI提取.zip文件 代码在开发和环境中运行良好 但在UAT环境中,即使AT和UAT都指向同一个远程主机,它也不能按预期工作 我在课堂上得到以下错误NoClassDefFoundError org/bouncycastle/crypto/modes/SICBlockCipher 请查找代码快照和异常 我们目前处于UAT阶段。你的帮助将受到感谢 JSch jsch= null; Session s

我正在进行一个项目,在这个项目中,我需要连接到远程AIX主机,以使用JSCHAPI提取.zip文件

代码在开发和环境中运行良好

但在UAT环境中,即使AT和UAT都指向同一个远程主机,它也不能按预期工作

我在课堂上得到以下错误NoClassDefFoundError org/bouncycastle/crypto/modes/SICBlockCipher

请查找代码快照和异常

我们目前处于UAT阶段。你的帮助将受到感谢

     JSch jsch= null;  
     Session session= null; 
     Channel channel= null; 
     InputStream in= null; 
     ChannelSftp channelSftp = null; 

     jsch=new JSch(); 
     session=jsch.getSession(remoteUserId, remoteHostName, 22); 
     session.setPassword(remotePassword); 
     session.setConfig("StrictHostKeyChecking", "no"); 

     channel = session.openChannel("sftp"); 
     channel.connect(); 
     channelSftp = (ChannelSftp)channel; 
     Vector<ChannelSftp.LsEntry> fileList= channelSftp.ls(remoteImageDir);



     java.lang.NoClassDefFoundError: org/bouncycastle/crypto/modes/SICBlockCipher 
     at org.bouncycastle.jce.provider.JCEBlockCipher.engineSetMode(Source) 
     at javax.crypto.Cipher$a_.a(Unknown Source) 
     at javax.crypto.Cipher.a(Unknown Source) 
     at javax.crypto.Cipher.init(Unknown Source) 
     at javax.crypto.Cipher.init(Unknown Source) 
     at com.jcraft.jsch.jce.AES256CTR.init(AES256CTR.java:57) 
     at com.jcraft.jsch.Session.checkCipher(Session.java:2072) 
     at com.jcraft.jsch.Session.checkCiphers(Session.java:2049) 
     at com.jcraft.jsch.Session.send_kexinit(Session.java:592) 
     at com.jcraft.jsch.Session.connect(Session.java:286) 
     at com.jcraft.jsch.Session.connect(Session.java:162) 
JSch-JSch=null;
会话=空;
通道=空;
InputStream in=null;
ChannelSftp ChannelSftp=null;
jsch=新的jsch();
session=jsch.getSession(remoteUserId,remoteHostName,22);
session.setPassword(remotePassword);
session.setConfig(“StrictHostKeyChecking”、“no”);
通道=会话.openChannel(“sftp”);
channel.connect();
channelSftp=(channelSftp)信道;
向量文件列表=channelSftp.ls(remoteImageDir);
java.lang.NoClassDefFoundError:org/bouncycastle/crypto/modes/SICBlockCipher
位于org.bouncycastle.jce.provider.JCEBlockCipher.engineSetMode(源代码)
在javax.crypto.Cipher$a_u.a(未知来源)
位于javax.crypto.Cipher.a(未知源)
位于javax.crypto.Cipher.init(未知源)
位于javax.crypto.Cipher.init(未知源)
位于com.jcraft.jsch.jce.AES256CTR.init(AES256CTR.java:57)
位于com.jcraft.jsch.Session.checkCipher(Session.java:2072)
位于com.jcraft.jsch.Session.checkCiphers(Session.java:2049)
位于com.jcraft.jsch.Session.send_kexinit(Session.java:592)
位于com.jcraft.jsch.Session.connect(Session.java:286)
位于com.jcraft.jsch.Session.connect(Session.java:162)

所有bouncy castle和正确的版本是否都在类路径中,还是与UAT上的jar一起打包?