FTP Connection Problem

Hi

I want to implement FTP to upload a file onto FTP Server.

I am using Jakarta Commons Net and Golden FTP Server for testing purpose.

I am able to connect to the server but soon it is throwing an exception which i am mentioning below.

Connected to 10.112.75.57.

org.apache.commons.net.ftp.FTPConnectionClosedException: Connection closed without indication.

at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:290)

at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:444)

at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:472)

at org.apache.commons.net.ftp.FTP.cwd(FTP.java:698)

at org.apache.commons.net.ftp.FTPClient.changeWorkingDirectory(FTPClient

.java:633)

at getDataFiles.getDataFiles(getDataFiles.java:39)

at getDataFiles.main(getDataFiles.java:12)

I have tried out in several ways and the firewall for my system is in OFF.

Could anyone get me the solution for this problem in detail asap.

Thanks in advance,

Vijay

[1041 byte] By [VijayGuttaa] at [2007-11-26 13:34:41]
# 1
are you able to connect to this ftp server from unix ftp command?
AjaySingh516a at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...
# 2
Ajay i didnt get you properly.Anyway i am connecting to the FTP Server but it is getting disconnected without indication and that is the exception it is throwing.
VijayGuttaa at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...
# 3
i was wondering if you are able to connect and browse the ftp site from the unix ftp command. If no - then there is issue with ftp site, its closing all the connections from the IP you are trying to connect.
AjaySingh516a at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...
# 4
Its not the case with FTP Site.I am implementing it in our lab only. I am able to connect to another system and the ip which is specified is the ip of another sys in lab.As soon as it is connecting it is throwing exception please suggest me
VijayGuttaa at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...
# 5
what does server logs say?
AjaySingh516a at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...
# 6
In Server logs nothing is seen where as i am able to trace the current working directory in server but soon it is getting the same exceptionAjay if u have worked on this and if your connection is persistent please give me the necessary instructions or paste the code.
VijayGuttaa at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...
# 7
> Ajay if u have worked on this and if your connection is persistent please give me the necessary instructions or paste the code.Without understanding the issue, i can't possibly give you right code...
AjaySingh516a at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...
# 8

Is the thing still not clear to u?

Its ok and this is at the first stage of FTP to connect to a FTP Server.

As soon as i am connecting to the server and if i am using some other ftp command (for ex: get list of files or changing the working directory) its throwing the exception which i have given it in first post.

I want to resolve it and my connection should be functioning until disconnect is called.

Now did u got me and now let me know the necessary.

VijayGuttaa at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...
# 9

The first thing you need to do is to get a ftp client - NOT java code.

You must run the ftp client from the computer where you are running the java code. Then you verify that you can actually do an ftp session with the server that you are attempting to run with.

It is NOT sufficient to run it from another box.

If you can't do it with an ftp client then you can't do it with java code.

jschella at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...
# 10

Hi

Now i am able to connect to another system using FTP and i am able to create directory there and the error is due to FTP Services.

But the thing is i want to upload a file onto the System which i have connected using FTP. Can anyone provide me useful info for uploading file onto FTP Server.

Respond asap.

Thanks in advance,

Vijay

VijayGuttaa at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...
# 11
I would suppose that the api has a method for that. The FTP command itself is STOR.
jschella at 2007-7-7 22:16:39 > top of Java-index,Core,Core APIs...