AY> However, it will be possible to work around such a field in JSch side
AY> as OpenSSH has done. So, I have done a quick hack,
AY> http://www.jcraft.com/jsch/jsch-0.1.45-sshd.zip
AY> Could you try it?
AY> # Frankly to say, I have not tried it by myself yet,
AY> # because I don't have enough time to do it.
I checked, it downloads file. In addition, I had to remove
cnlSFTP.setFilenameEncoding("ISO-8859-15");
because in ChannelSession.setFilenameEncoding()
if(sversion > 3 ...
changed to
if(sversion >= 3 ...
No problem with that. I think, it's best to set it to UTF8 in talend
studio to avoid problems.
--

Hi,
+-From: Ilya Basin <basinilya@...> --
|_Date: Tue, 29 Mar 2011 18:56:46 +0400 ___
|
|Hi. I need to execute a command with timeout. In a TimerTask
|Session.disconnect() is called. I expect some exception in main
|thread from ChannelExec.getInputStream().read(), but it simply returns
|EOF.
|Same when I close connection in TCPView.
|How to distinguish disconnect and empty result? By getExitStatus() == -1 ?
"-1" means exit-status has not been given yet.
So, it will be good idea to refer to that value
to check if the connection is successfully finished or not.
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/
Twitter: http://twitter.com/ymnk

Hi,
+-From: Ilya Basin <basinilya@...> --
|_Date: Tue, 29 Mar 2011 17:54:44 +0400 ___
|
|Hi list. Please see this ticket.
|https://issues.apache.org/jira/browse/SSHD-105
|Whose bug is it? Don't know the protocol.
...
|Caused by: java.lang.IndexOutOfBoundsException
|at java.io.PipedInputStream.read(PipedInputStream.java:355)
|at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2325)
|at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2317)
|at com.jcraft.jsch.ChannelSftp.checkStatus(ChannelSftp.java:1930)
|at com.jcraft.jsch.ChannelSftp._sendCLOSE(ChannelSftp.java:1943)
|at com.jcraft.jsch.ChannelSftp._get(ChannelSftp.java:975)
|... 26 more
|Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.656 sec <<< FAILURE!
|{code}
It seems to me that it is an implementation bug of org.apache.sshd.
According to its source code, org.apache.sshd sends the following "SSH_FXP_DATA"
packet[1],
byte SSH_FXP_DATA
uint32 request-id
string data
bool end-of-file [optional]
and 'end-of-file' field has been defined since sftp protocol version 6[2].
It seems the current org.apache.sshd version will support sftp protocol version 3,
so "org.apache.sshd" should not send such a field.
However, it will be possible to work around such a field in JSch side
as OpenSSH has done. So, I have done a quick hack,
http://www.jcraft.com/jsch/jsch-0.1.45-sshd.zip
Could you try it?
# Frankly to say, I have not tried it by myself yet,
# because I don't have enough time to do it.
[1] http://tools.ietf.org/html/draft-ietf-secsh-filexfer-07#section-8
[2] http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-07-from-06.diff.html
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/
Twitter: http://twitter.com/ymnk