Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
8.7k views
in Java FTP by (360 points)
Hi,

We are using edtftpj-pro.jar (edtftpj-pro-4.1.0).

We are trying to get list of directory using dirDetails() in a loop. At one of our clients, it is observed that after some time the dirDetials() gets into a loop and control does not come back to our code.

Here is the ftp trace -
I have given last two iterations of dirDetails, observe that once we get the Can't open data connection, there is no activitty.
We also tried with the latest version o edtftpj-pro-4.4.0. Still we observed the same problem.

DEBUG [FTPControlSocket] 13

12 Answers

0 votes
by (161k points)
Maybe post your code to show us what you are doing.
0 votes
by (360 points)
Its a big class so cannot paste everything here...
The flow is like this:
We have class which is extending SSLFTPClient. In this class we have written a method called dirSubdirAsXML(String folderPath).
We create object of our class and return the reference to the caller code.
Using the reference, we keep on calling dirSubdirAsXML(String folderPath) method after every 3 secs.
The dirSubdirAsXML(String folderPath) has below code in it..
FTPFile[] files=dirDetails(path);

So after few iterations, it is observed that the control doesn't come back to the caller.

Please let me know if u need more explaination.

Thank you.
Regards
- Bhagyashree
0 votes
by (161k points)
Please email us the entire zipped log file and the code - to support at our domain name.
0 votes
by (360 points)
the trace snippet i gave did'nt had the problematic log. Below is the log with LIST command invoked three times. It was successful twice and the third time it gave can't open data connection.

DEBUG [FTPControlSocket] 12
0 votes
by (161k points)
It fails the third time because you are running out of TCP sockets - there is a limited number available and lots of frequent listings exhaust them. If listing fails, you should catch the exception, wait 30 sec, and then retry.
0 votes
by (360 points)
Hi,
The problem is not solved even after increasing the delay between each LIST command to 1 minute. Below is the scenario how we call the LIST method.
In out code, we log-in and connect to the ftp server from two different threads.
1st thread opens the connection, issues CWD and closes the connection after every 5 minute.
2nd thread after every 1 minute, opens the connection, issues issues dirdetails() method and closes the connection using quit() method.

After around 23 hours, It is observed that 1st thread is working properly but in case of 2nd thread the control does not come back to our code.

Also now we don't get any error can't open data connection which was coming earlier (when we used to issue LIST method after every 3 secs. without closing and connecting after it for each iteration).

Below is the trace log.

DEBUG [SSLFTPClient] 20
0 votes
by (161k points)
Connecting to 91.199.99.72:1924 via standard socket
DEBUG [SSLSocket] 20
0 votes
by (360 points)
Hi,

Thanks for your support. The problem got solved by increasing the delay between invocation each dirDetails() methods by 5 minutes.

Thank you.
Regards
- Bhagyashree
0 votes
by (360 points)
Hi,

We are getting a new problem now. This exception comes after 10 days. The exception is as below.
Exception at 29/07/2013 05:40:52:java.net.ConnectException: Connection timed out: connect
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.enterprisedt.util.proxy.PlainSocket.createPlainSocket(PlainSocket.java:112)
at com.enterprisedt.util.proxy.StreamSocketFactory.getConnectedSocket(StreamSocketFactory.java:68)
at com.enterprisedt.net.ftp.ssl.SSLFTPClient.connect(SSLFTPClient.java:848)
at com.magicsoftware.ibolt.ftpwrapper.IBFTPClient.init(Unknown Source)
at com.magicsoftware.ibolt.ftpwrapper.IBFTPClient.<init>(Unknown Source)

Any suggestions?
Thank you.
Regards
- Bhagyashree
0 votes
by (161k points)
What do you mean after 10 days?

It looks like it couldn't connect - a temporary network problem?

Categories

...