Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

FTP site works but I'm unable to connect from Java program. I get java.net.UnknownHostException  RSS feed

 
Karthic Raghupathi
Greenhorn
Posts: 9
Java jQuery Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings folks.

I have this weird problem. In the project I'm working on now, I need to upload a file to a FTP site. I have written many programs that do this before and they have worked just fine. But this particular site is giving me trouble. When I try to upload the file from the program, I get this to be specific:

java.net.UnknownHostException: ftp://site.com


However when I try to connect to the same site from within a browser (Chrome, IE) or from windows explorer, I'm able to find the site and login just fine.



So I'm stumped now. If I could not connect from windows, then I can assume it is a FTP server issue. This happens to me only from the Java program. And I also know that my code works as I have used in numerous occasions before. Here is the code I use:



I use the edtFTPj library. My environment is Eclipse Helios (32 bit) on Java 1.6 (32 bit) running from a Windows 7 64 bit machine.

Any insight on resolving this will be greatly appreciated. Thanks for your time.
 
Karthic Raghupathi
Greenhorn
Posts: 9
Java jQuery Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind people. I just figured this out.

The parameter I was passing to the code was ftp://site.com which is a URL. I must have passed just site.com.

That did the trick. Thanks for your times.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!