0

I got this method do connect to a local or remote FTP server. When I start this method in Eclipse (IDE), it works fine. But when I try to run it in EBUS-J (it's a Java source code generator with a programming language like BASIC) it wont go pass the connect method. Here is the method:

    public String doConnect() {
    try {

        System.out.println("before connection");        

        this.ftps.connect(this.server);     

        System.out.println("before SetBufferSize");
        this.ftps.setBufferSize(1000);
        System.out.println("before Login");
        if (!this.ftps.login(this.username, this.password)) {
            this.ftps.logout();
            System.out.println("logged out");
        }
        System.out.println("before positiveCompletion");
        if (!FTPReply.isPositiveCompletion(this.ftps.getReplyCode())) {
            this.ftps.disconnect();
            System.out.println("disconnected");
            return returnTrue("false");
        } else {
            return returnTrue("true");
        }
    } catch (Exception e) {
        return returnFalse("Couldnt connect to server");
    }
}

And here is what my local server says, if it successful out of eclipse. When I start my generated Program by my Interpreter, it stops at "AUTL TLS", see at bottom:

(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> Connected, sending welcome message...
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> 220-FileZilla Server version 0.9.41 beta
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> AUTH TLS
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> 234 Using authentication type TLS
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> SSL connection established
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> USER root
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> 331 Password required for root
(000001)29.05.2017 12:59:49 - (not logged in) (127.0.0.1)> PASS 
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> 230 Logged on
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> TYPE I
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> 200 Type set to I
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> PASV
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> 227 Entering Passive Mode (127,0,0,1,219,159)
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> STOR Beispieldatei.txt
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> 150 Connection accepted
(000001)29.05.2017 12:59:49 - root (127.0.0.1)> disconnected.

(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> Connected,     sending welcome message...
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> 220-FileZilla     Server version 0.9.41 beta
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> AUTH TLS
(000030)10.05.2017 16:51:20 - (not logged in) (127.0.0.1)> 234 Using authentication type TLS
(000030)10.05.2017 16:52:20 - (not logged in) (127.0.0.1)> 421 Login time exceeded. Closing control connection.

Here is the log file with the newest FileZilla version:

(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> Connected on port 21, sending welcome message...
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> 220-FileZilla Server 0.9.60 beta
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (tim.kosse@filezilla-project.org)
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> 220 Please visit https://filezilla-project.org/
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> AUTH TLS
(000003)29.05.2017 14:38:19 - (not logged in) (127.0.0.1)> 234 Using authentication type TLS
(000003)29.05.2017 14:39:19 - (not logged in) (127.0.0.1)> 421 Login time exceeded. Closing control connection.
(000003)29.05.2017 14:39:19 - (not logged in) (127.0.0.1)> disconnected.

As I mentioned, running it in eclipse works fine, but with EBUS-J, it wont pass the SSL/TLS handshake I guess.

  • I don't get an exception or error message.
  • I can wait more than a minute before the server closes the connection, so I cancelled it directly. -> 1 second.

Any ideas? Thanks, Louis

Michał Szkudlarek
  • 1,443
  • 1
  • 21
  • 35
  • What does it mean *"Java sourcecode generator with a programming language like BASIC"*? So you write a Basic-like code and EBUS-J generates the Java code seen in your question? And then what? What happens with the Java code? How is it run? – Martin Prikryl May 29 '17 at 07:52
  • Do you get any error/exception? + What does the server log look like, when you execute the code in Eclipse? + Why do you "guess" that the problem is TLS handshake? + Why do you get "Login time exceeded" only after **1 second**? – Martin Prikryl May 29 '17 at 07:55
  • You didn't explain the EBUS-J thing + Did you try to debug Commons Net code to see where it hangs? + Did you check if you get the same problem with other FTP(S) servers? + You are using 5 years old version of FileZilla Server. Upgrade first! – Martin Prikryl May 29 '17 at 11:17
  • Mh, I used the XAMPP integrated FileZilla Server. Didnt know, that this one is so old. I tried another server in the past, but I am going to get the newest one one. When Debugging, there is no Error - it just debugs and voila. Compiling also without any error. EBUS-J is an Interpreter, which generates Java Code. It can insert normal java code also and run it - which doesnt work in my case. Trying now the new filezilla. –  May 29 '17 at 12:30
  • Do you mean that, when debugging, the code works even in EBUS-J? – Martin Prikryl May 29 '17 at 12:31
  • yeah, that works fine and I can compile my program. But when i start it, the upload doesnt work - im standing at the point, as you can see above. –  May 29 '17 at 12:40

0 Answers0