yaroslavambrozyak commented on issue #527:
URL: https://github.com/apache/mina-sshd/issues/527#issuecomment-2217933501
Thanks for the quick reply. I have tried to use 'true' flag when
constructing
```
DefaultSftpSessionFactory defaultSftpSessionFactory = new
DefaultSftpSessionFactory(sshClient, true);
```
it does not throw connection reset by peer but throws another one
```
Caused by: org.apache.sshd.common.SshException: Channel is being closed
at
org.apache.sshd.sftp.client.impl.DefaultSftpClient.receive(DefaultSftpClient.java:319)
at
org.apache.sshd.sftp.client.impl.AbstractSftpClient.response(AbstractSftpClient.java:181)
at
org.apache.sshd.sftp.client.impl.AbstractSftpClient.rpc(AbstractSftpClient.java:169)
at
org.apache.sshd.sftp.client.impl.AbstractSftpClient.checkHandle(AbstractSftpClient.java:290)
at
org.apache.sshd.sftp.client.impl.AbstractSftpClient.open(AbstractSftpClient.java:589)
at
org.apache.sshd.sftp.client.impl.SftpOutputStreamAsync.<init>(SftpOutputStreamAsync.java:63)
at
org.apache.sshd.sftp.client.impl.AbstractSftpClient.write(AbstractSftpClient.java:1213)
at org.apache.sshd.sftp.client.SftpClient.write(SftpClient.java:940)
at org.apache.sshd.sftp.client.SftpClient.write(SftpClient.java:936)
```
the code itself is pretty straightforward, it just writes the JSON input to
a file via SftpRemoteFileTemplate
```
void write(String filePath, byte[] fileData) {
sftpRemoteFileTemplate.execute((session) -> {
ByteArrayInputStream inputStream = new
ByteArrayInputStream(fileData);
session.write(inputStream, filePath);
});
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]