ArrayIndexOutOfBoundException occurring while using Jsch sftp channel
Status: Alpha
Brought to you by:
ymnk
hi, getting ArrayIndexOutOfBoundException while using sftp channel for csv files transfers and it seems like the buf.reset() is not resetting the buffer while reading . The issue however doesn't occur while debugging by setting the breakpoint at globe_remote(path)... buf.reset() and going step by step. Could you kindly advise what could be the reason and how to fix the error. Thanks
i'm able to bypass that issue by setting the change directory on the sftp channel. So this ticket can be closed but it will be good if we can find a way to reset the buffer externally so that it doesn't throw ArrayIndexOutOfBoundException
on further analysis, its found that the issue is due to wildcard character ( * ) due to which glob_remote throws ArrayIndexOutOfBoundException. workaround do ls and give complete file name as paramter to get method. followed below steps
1. set change directory
2. do ls to get all the files (its available in vectors)
3. give complete file name as source for the get method