Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.
no avatar
User

ReiniBugman

Posts

2

Joined

Tue Jun 10, 2008 6:22 pm

Getting SocketTimeoutException when calling FTPClient.exists

by ReiniBugman » Tue Jun 10, 2008 6:33 pm

Hello,
as described in the subject I'm getting a SocketTimeOutException when calling
FTPClient.exists().
Anything else works fine - to work around this exception I read the whole directory
with FTPClient.directoryNameList() and go through the string array to check if it contains
the file but I would prefer to call exists() if possible.
BTW - I'm connecting to an IBM-mainframe if this is of importance to you.

Here's the log:

Version: 2.0.3
Build timestamp: 6-Jun-2008 14:04:32 EST
Java version: 1.4.2_17
CLASSPATH: C:\ccm\LoadFileEditor\bin;C:\ccm\LoadFileEditor\lib\edtftpj.jar;C:\ccm\LoadFileEditor\lib\jcalendar-1.3.2.jar;C:\ccm\LoadFileEditor\lib\jxl.jar
OS name: Windows 2000
OS arch: x86
OS version: 5.0

DEBUG [FileTransferClient] 10 Jun 2008 10:10:28.223 : Configured client
DEBUG [FTPClient] 10 Jun 2008 10:10:28.223 : Connecting to host-obk/30.255.10.1:21
DEBUG [SocketUtils] 10 Jun 2008 10:10:28.223 : Invoking connect with timeout=60000
DEBUG [SocketUtils] 10 Jun 2008 10:10:28.223 : Connected successfully
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.223 : 220-TCPFTPDL IBM FTP CS V1R9 at SYS1, 08:10:41 on 2008-06-10.
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.364 : 220 Connection will close if idle for more than 5 minutes.
DEBUG [FileTransferClient] 10 Jun 2008 10:10:28.364 : Client connected
DEBUG [FileTransferClient] 10 Jun 2008 10:10:28.364 : Logging in
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.364 : ---> USER XXXXXX
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.364 : 331 Send password please.
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.364 : ---> PASS ********
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.505 : 230 XXXXXX is logged on. Working directory is "XXXXXX.".
DEBUG [FileTransferClient] 10 Jun 2008 10:10:28.505 : Logged in
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.505 : ---> TYPE I
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.505 : 200 Representation type is Image
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.505 : ---> TYPE A
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.520 : 200 Representation type is Ascii NonPrint
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.520 : ---> CWD 'PDBEBS.TABEX.'
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:28.520 : 250 "PDBEBS.TABEX." is working directory name prefix
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:32.317 : ---> SIZE 'PDBEBS.TABEX.LOAD.PARAM'
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:32.333 : 501 command aborted - FTP server not configured for SIZE
DEBUG [FTPClient] 10 Jun 2008 10:10:32.333 : SIZE not supported - trying MDTM
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:32.333 : ---> MDTM 'PDBEBS.TABEX.LOAD.PARAM'
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:32.333 : 501 command aborted - FTP server not configured for MDTM
DEBUG [FTPClient] 10 Jun 2008 10:10:32.349 : MDTM not supported - trying RETR
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:32.364 : ---> PORT 10,101,12,107,10,240
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:32.364 : 200 Port request OK.
DEBUG [FTPControlSocket] 10 Jun 2008 10:10:32.364 : ---> RETR 'PDBEBS.TABEX.LOAD.PARAM'

java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:910)
at com.enterprisedt.net.ftp.FTPControlSocket.sendCommand(FTPControlSocket.java:878)
at com.enterprisedt.net.ftp.FTPClient.exists(FTPClient.java:1867)
at com.enterprisedt.net.ftp.FileTransferClient.exists(FileTransferClient.java:753)
at at.dbeg.lfe.eventhandling.SaveFileAction.paramFileIsEmpty(SaveFileAction.java:78)
at at.dbeg.lfe.eventhandling.SaveFileAction.actionPerformed(SaveFileAction.java:130)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Regards,
Reinhard
no avatar
User

ReiniBugman

Posts

2

Joined

Tue Jun 10, 2008 6:22 pm

Re: Getting SocketTimeoutException when calling ...

by ReiniBugman » Thu Jun 12, 2008 8:28 pm

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Getting SocketTimeoutException when calling ...

by support2 » Fri Jun 13, 2008 4:21 pm

Yes. It's not the greatest way of finding if a file exists, using PORT (although it is a fallback used only if SIZE doesn't work etc). We may end up doing a directory list instead of PORT at some point.

Who is online

Users browsing this forum: No registered users and 12 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign