Menu

#39 ArrayIndexOutOfBoundException occurring while using Jsch sftp channel

v1.0 (example)
open
nobody
None
3
2021-05-23
2021-05-23
No

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

Discussion

  • Mohammed Shabbir

    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

     
  • Mohammed Shabbir

    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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.