Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
6k views
in Java FTP by (160 points)
We have a mainframe system to which we ftp files everyday. Sometime we get "Can't open passive connection." exception from the mainframe. What could be the possible reason for this? Below is the stack trace for the error.

com.enterprisedt.net.ftp.FTPException: Can't open passive connection.
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:996)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketPASV(FTPControlSocket.java:667)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:482)
at com.enterprisedt.net.ftp.FTPClient.setupDataSocket(FTPClient.java:2160)
at com.enterprisedt.net.ftp.FTPClient.initPut(FTPClient.java:2195)
at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2278)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2021)
at com.test.eai.common.ftp.FtpUtility.ftpFromStreamToRemote(FtpUtility.java:396)
at com.test.eai.process.ImportProcess.ftpData(PromptCOAImportProcess.java:376)

Any help on this issue is really appreciated. We use the version "edtftpj-2.0.0".

3 Answers

0 votes
by (162k points)
Please post the relevant piece of the log file where this error occurs.
0 votes
by (160 points)
Please find below the log content.

31 [main] DEBUG FTPClient - Connecting to dlxSys/10.111.12.24:21
31 [main] DEBUG SocketUtils - Invoking connect with timeout=60000
31 [main] DEBUG SocketUtils - Connected successfully
78 [main] DEBUG FTPControlSocket - 220-FTPSERVE IBM FTP CS V1R8 at dlxSys.MOR.COM, 18:11:43 on 2008-0
375 [main] DEBUG FTPControlSocket - 220 Connection will close if idle for more than 5 minutes.
connected
375 [main] DEBUG FTPControlSocket - ---> USER ftpusr
375 [main] DEBUG FTPControlSocket - 331 Send password please.
375 [main] DEBUG FTPControlSocket - ---> PASS ********
656 [main] DEBUG FTPControlSocket - 230 FTPUSR is logged on. Working directory is "FTPUSR.".
656 [main] DEBUG FTPControlSocket - ---> SITE PRI=75 SEC=10 TRACKS
656 [main] DEBUG FTPControlSocket - 200 SITE command was accepted
656 [main] DEBUG FTPControlSocket - ---> PASV
672 [main] DEBUG FTPControlSocket - 425 Can't open passive connection.
672 [main] INFO FTPControlSocket - Expected reply code = [227]
672 [main] ERROR FTPClient - Caught and rethrowing exception in initPut()
com.enterprisedt.net.ftp.FTPException: Can't open passive connection.
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:996)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketPASV(FTPControlSocket.java:667)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:482)
at com.enterprisedt.net.ftp.FTPClient.setupDataSocket(FTPClient.java:2160)
at com.enterprisedt.net.ftp.FTPClient.initPut(FTPClient.java:2195)
at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2278)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2021)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2003)
at MyFTP.ftpToRemoteDir(MyFTP.java:46)
at MyFTP.main(MyFTP.java:17)
687 [main] DEBUG FTPClient - Transferred 0 bytes to remote host
com.enterprisedt.net.ftp.FTPException: Can't open passive connection.
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:996)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketPASV(FTPControlSocket.java:667)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:482)
at com.enterprisedt.net.ftp.FTPClient.setupDataSocket(FTPClient.java:2160)
at com.enterprisedt.net.ftp.FTPClient.initPut(FTPClient.java:2195)
at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2278)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2021)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2003)
at MyFTP.ftpToRemoteDir(MyFTP.java:46)
at MyFTP.main(MyFTP.java:17)
0 votes
by (162k points)
The server is saying it can't open a passive socket. It isn't obvious why - can you do a passive transfer with any other FTP clients? Perhaps you should try active mode.

Categories

...