-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArrayIndexOutOfBoundsException when using JSch library (version 0.2.22) for SSH connection #767
Comments
Could it be caused by adding the following configurations? JSch.setConfig("server_host_key", JSch.getConfig("server_host_key") + ",ssh-rsa"); Here are the SFTP connection details from the server: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 |
The program initially had no issues connecting and uploading. However, after running for two days, it reported this error. Moreover, attempts to reconnect and upload again resulted in the same error. Restarting the service resolved the issue on its own. |
We are encountering an issue while attempting to establish an SSH connection using version 0.2.22 of the JSch library in our application. Below is the stack trace for the exception encountered:
java.lang.ArrayIndexOutOfBoundsException: null
at java.lang.System.arraycopy(Native Method)
at com.jcraft.jsch.Buffer.putByte(Buffer.java:60)
at com.jcraft.jsch.Buffer.putString(Buffer.java:70)
at com.jcraft.jsch.Buffer.putString(Buffer.java:65)
at com.jcraft.jsch.DHXEC.next(DHXEC.java:172)
at com.jcraft.jsch.Session.connect(Session.java:342)
at com.goldwind.pf.report.infrastructure.util.SFTPUtil.login(SFTPUtil.java:96)
at com.goldwind.pf.report.infrastructure.util.SFTPUtil.login(SFTPUtil.java:78)
at com.goldwind.pf.report.domain.reportupload.service.impl.SftpStrategy.upload(SftpStrategy.java:99)
at com.goldwind.pf.report.domain.process.impl.UploadFileProcess.uploadFile(UploadFileProcess.java:111)
at com.goldwind.pf.report.domain.process.impl.UploadFileProcess.lambda$upload$1(UploadFileProcess.java:99)
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
This error appears to occur during the key exchange process (DHXEC.next) when invoking Session.connect. We have verified that all parameters passed to the JSch methods are valid and there are no apparent issues such as insufficient memory in our environment.
Could you please provide insights into what might be causing this ArrayIndexOutOfBoundsException specifically in version 0.2.22 of JSch? Are there any known bugs or recommended workarounds for this scenario?
Thank you for your assistance.
The text was updated successfully, but these errors were encountered: