Somnath Mallick wrote: I can understand what the error means but dont know how to resolve it.
So what does the error mean? It would be a good idea if you posted that -- you might not really understand it after all. (Since you posted some code, that suggests you might not understand it.)
Well one thing i understood is that the connection is refused maybe because I am using the wrong IP address, or incorrect user name and password. But not more than that!
I tried with 21 as well and it didn't work and i got the same connection refused exception. I posted the code so that you can check out what went wrong. Could it be a firewall issue?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35223
7
posted
0
Rob Prime wrote:Can you access the FTP site with the username and password using a regular FTP client like FileZilla?
I tried it through filezilla but didn't connect. Actually I am using an office PC. Many people have used that PC. Also my account is not an administrator account. I tried to connect using my Login Credentials! Do i need the Admin username and password for this?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35223
7
posted
0
So the problem then has nothing to do with the Java code - it is a general connection problem?
Antany Vasanth
Ranch Hand
Joined: Jan 28, 2009
Posts: 43
posted
0
Hi Somnath
Please verify the ftp services are enabled in your windows machine.
For enabling FTP services in windows go through the following link
I followed the instruction and completed this task:
A. XP includes a built-in FTP service component that lets FTP clients connect to the machine and read or write files; however, this service doesn't install by default. To install the FTP service, perform the following steps:
1. Start the Control Panel Add/Remove Programs applet (go to Start, Control Panel, then click Add/Remove Programs).
2. Select Add/Remove Windows Components.
3. Select Internet Information Services (IIS), then click Details.
4. Select the File Transfer Protocol (FTP) Service check box, then click OK.
5. Click OK to close all dialog boxes.
Also, you may prefer the FileZilla FTP server over the IIS one. It's a bit easier to work with, especially with user accounts. IIS can only use the built-in Windows users, if I recall correctly.
Antany Vasanth
Ranch Hand
Joined: Jan 28, 2009
Posts: 43
posted
0
Hi Somnath,
In your windows machine open command prompt and type "ftp localhost". If it prompts for user name then that means you have successfully enabled the FTP Services and the problem is with the communication between two machines.
Try to ping your windows machine from the Sun OS machine from where you are executing the Java program. Also check your firewall settings.
Kindly ensure to use port "21"(Defalut FTP Port)
Regards,
Antany
Somnath Mallick
Ranch Hand
Joined: Mar 04, 2009
Posts: 471
posted
0
Apologies for the late reply.
Thanks Antany. I tried what you mentioned and its working. But the only thing is that which user name and password do i enter? The PC has several user accounts do i enter any of those details or is the FTP user name and password totally different?
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Unable to connect to Windows Machine Using FTPClient...