Note that there are some explanatory texts on larger screens.

plurals
  1. POFTP site works but I'm unable to connect from Java program. I get java.net.UnknownHostException
    primarykey
    data
    text
    <p>Greetings folks.</p> <p>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:</p> <blockquote> <p>java.net.UnknownHostException: <a href="ftp://site.com" rel="nofollow">ftp://site.com</a></p> </blockquote> <p>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. I tired posting a picture, but I was prevented from doing so as I'm a newbie.</p> <p>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:</p> <pre><code> public void uploadFile(String fileName) throws Exception { FileTransferClient ftpClient = null; try { ftpClient = new FileTransferClient(); ftpClient.setRemoteHost(gv.ftpHost); ftpClient.setRemotePort(21); ftpClient.setUserName(gv.ftpUserName); ftpClient.setPassword(gv.ftpPassword); ftpClient.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.PASV); ftpClient.connect(); ftpClient.uploadFile(gv.irp + fileName, fileName, WriteMode.OVERWRITE); } catch (Exception e) { throw new Exception("Error occured in uploadFile()\n" + e); } finally { if (ftpClient != null) { if (ftpClient.isConnected()) { ftpClient.disconnect(); } ftpClient = null; } } } </code></pre> <p>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.</p> <p>Any insight on resolving this will be greatly appreciated. Thanks for your time.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload