com.jcraft.jsch.JSchException: connection is closed by foreign host

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

Ant scp task has an attribute called trust. If set to false (default) the host you connect to has to be set in the knownhosts file (you might have to create it) Another way is to explicitly set "trust = true". Check the documentation: https://goo.gl/G5680x

Solutions on the web

via mqseries.net by Unknown author, 1 year ago
connection is closed by foreign host
via Stack Overflow by user2500313
, 10 months ago
Session.connect: java.net.SocketException: Connection reset
via jsch by kameshc
, 1 year ago
connection is closed by foreign host
via linuxforums.org by Unknown author, 1 year ago
Session.connect: java.net.SocketException: Connection reset by peer: socket write error
via Stack Overflow by MusikPolice
, 1 year ago
Session.connect: java.security.InvalidKeyException: Key is too long for this algorithm
com.jcraft.jsch.JSchException: connection is closed by foreign host
at com.jcraft.jsch.Session.connect(Session.java:269)
at client.JschClient.sendFile(JschClient.java:29)
at client.JschClient.main(JschClient.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)

Users with the same issue

2 times, 1 month ago
10 times, 11 months ago
3 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 6 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.