Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.5k views
in Java FTP by (120 points)

My SFTPClient using edtftpjPRO 3.1 version is throwing below error on SFTP.connect.

INFO [com.mibs.ftp.SFTPConnectToServer] 29 Apr 2016 11:36:51.102 : Creating SFTP client
INFO [LicensePropertiesBase] 29 Apr 2016 11:36:51.106 : Licence expiry date: 31 Dec 9999
INFO [LicensePropertiesBase] 29 Apr 2016 11:36:51.107 : Production licence
INFO [com.mibs.ftp.SFTPConnectToServer] 29 Apr 2016 11:36:51.109 : Setting remote host
INFO [com.mibs.ftp.SFTPConnectToServer] 29 Apr 2016 11:36:51.110 : Loading client private-key from /opt/app/glassfish/domains/domain1/applications/j2ee-modules/dtb/WEB-INF/classes/com/mibs/ftp/new_dsa.ppk
INFO [com.mibs.ftp.SFTPConnectToServer] 29 Apr 2016 11:36:51.110 : Setting user-name, private key file and password
INFO [PuTTYPrivateKeyFormat] 29 Apr 2016 11:36:51.113 : Unpacking puTTY formatted private key
INFO [com.mibs.ftp.SFTPConnectToServer] 29 Apr 2016 11:36:51.118 : Connecting to server 10.2.1.1
INFO [SCPClient] 29 Apr 2016 11:36:51.119 : SCPClient settings validated.
INFO [TransportProtocolCommon] 29 Apr 2016 11:36:51.124 : Timeout=60000
INFO [TransportProtocolCommon] 29 Apr 2016 11:36:51.124 : Wait for state update timeout=60000
INFO [TransportProtocolCommon] 29 Apr 2016 11:36:51.137 : Wait for state update timeout=60000
INFO [DhGroup1Sha1] 29 Apr 2016 11:36:51.180 : Starting client side key exchange.
ERROR [TransportProtocolCommon] 29 Apr 2016 11:36:51.221 : The Transport Protocol thread failed : The socket is EOF
java.io.IOException: The socket is EOF
    at com.enterprisedt.net.j2ssh.transport.A.A(Unknown Source)
    at com.enterprisedt.net.j2ssh.transport.A.B(Unknown Source)
    at com.enterprisedt.net.j2ssh.transport.TransportProtocolCommon.readMessage(Unknown Source)
    at com.enterprisedt.net.j2ssh.transport.kex.DhGroup1Sha1.performClientExchange(Unknown Source)
    at com.enterprisedt.net.j2ssh.transport.TransportProtocolClient.performKeyExchange(Unknown Source)
    at com.enterprisedt.net.j2ssh.transport.TransportProtocolCommon.beginKeyExchange(Unknown Source)
    at com.enterprisedt.net.j2ssh.transport.TransportProtocolCommon.A(Unknown Source)
    at com.enterprisedt.net.j2ssh.transport.TransportProtocolCommon.startBinaryPacketProtocol(Unknown Source)
    at com.enterprisedt.net.j2ssh.transport.TransportProtocolCommon.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:662)
 

My client program below

// create client
            log.info("Creating SFTP client");
            SSHFTPClient ftp = new SSHFTPClient();

            // set remote host
            log.info("Setting remote host");
            ftp.setRemoteHost(host);
            
            // the client's public key file must be in authorized_keys or
            // the equivalent on the server
            log.info("Loading client private-key from " + keyfile);
            log.info("Setting user-name, private key file and password");
            ftp.setAuthentication(keyfile, username, password);
            
            //log.info("Turning off server validation");
            ftp.getValidator().setHostValidationEnabled(false);

            log.info("Connecting to server " + host);
            ftp.connect();
            
            // set transfer buffer size
            // we set this to a number much smaller than the size of the
            // file to be transferred. Progress is only updated when the
            // transfer buffer is emptied
            log.info("Setting transfer buffer size to 512 bytes");
            ftp.setTransferBufferSize(512);

            // use binary so file sizes can be compared precisely
            log.info("Setting transfer mode to BINARY");
            ftp.setType(FTPTransferType.BINARY);

            //log.info("Uploading file");
            //for [unix]
            log.info("Change directory to " + mibsdir+"/"+brno);
            ftp.chdir(mibsdir+"/"+brno);
            //for [windows]
            //log.info("Change directory to " + mibsdir+"\\"+brno);
            //ftp.chdir(mibsdir+"\\"+brno);
            
            // put the file
            //ftp.put(filename, filename);
            log.info("Transfer from " + localdir+File.separatorChar+brno+File.separatorChar+filename);
            ftp.put(localdir+File.separatorChar+brno+File.separatorChar+filename, filename);
            log.info("Successfully transferred in BINARY mode");
            //log.info("File uploaded");

            // Shut down client
            log.info("Quitting client");
            ftp.quit();

            log.info("SFTP complete");
            Logger.shutdown();
 

Please help why this happens. I created new keys and able to SFTP from SSH without password being prompted. Only through program the issue arises. Please help asap.

by (161k points)
We don't support 3.1.0 any more - you'll need to upgrade. Please do so and lodge a support ticket here:  http://enterprisedt.com/support/index.php

Please log in or register to answer this question.

Categories

...