0

I am getting exception "The message store has reached EOF" when I try to connect to remote host for SFTP using "com.enterprisedt.net.ftp.ssh.SSHFTPClient" class (edtFTPj/PRO - a commercial Java file transfer client).

I am able to successfully connect to another remote host for SFTP with the same code.

Is there any configuration specific to the particular host which is causing the problem? If that is the case, is there any way to confirm it? I don't have any other log other than this exception message. However, I can change the code to try any suggested debugging options.

Please note that I can't use other SFTP library as my existing code is already using this library.

com.enterprisedt.net.j2ssh.authentication.AuthenticationProtocolException: Failed to read messages
    at com.enterprisedt.net.j2ssh.authentication.AuthenticationProtocolClient.a(AuthenticationProtocolClient.java:265)


Caused by: com.enterprisedt.net.j2ssh.transport.MessageStoreEOFException: The message store has reached EOF
    at com.enterprisedt.net.j2ssh.transport.SshMessageStore.getMessage(SshMessageStore.java:177)
    at com.enterprisedt.net.j2ssh.transport.SshMessageStore.getMessage(SshMessageStore.java:110)
    at com.enterprisedt.net.j2ssh.authentication.AuthenticationProtocolClient.a(AuthenticationProtocolClient.java:261)
    ... 31 more
notionquest
  • 37,595
  • 6
  • 111
  • 105
  • What version of the library are you using? If you're not sure you can check by extracting the file, META-INF\MANIFEST.MF, from edtftpj-pro.jar using Java's jar tool or an unzip tool, and then looking for "Version:" – HansA Aug 29 '16 at 04:49
  • I am using version 4.0.0. – notionquest Aug 30 '16 at 12:34
  • 1
    That version is nearly five years old. It's probably been fixed since then. If you've got a current support agreement with EnterpriseDT you can download the latest version from the website, otherwise there's a 30-day free trial that you can try. You just need to substitute the jar file from either of those. – HansA Sep 01 '16 at 00:12

1 Answers1

0

I think there is a problem with the library itself. A concurrency problem. I could reproduce this and other random errors consistently when you try to open many connections at the same time (in the same millisecond), for example, when you use multiple threads to do that. This happens even if you use several different SSHFTPClient instances. I think there should be a static thing inside those classes.

I had to synchronize the access of any SSHFTPClient instances using a third variable, like this:

final static String sincronizadorUnico = "";

    synchronized (sincronizadorUnico) {
        // use the code to connect
    }

The it will work. I will report the bug to the library. I'm using 7.1.0 version of library.