title: java.net.SocketException: Malformed reply from SOCKS server, With apache FTPClient
body: <p>I am trying to connect to FTP Server using Apache FTPCleint in java web start aplication.
  Below is the code i am using.</p>
  
  <pre><code>ftpInstance = new FTPClient();
  
  ftpInstance.setRemoteVerificationEnabled(false);
  
  ftpInstance.connect(&lt;HostName&gt;);
  int rpyCode = ftpInstance.getReplyCode();
  
  if(!FTPReply.isPositiveCompletion(rpyCode)){
      throw new Exception("Connection Rejected with reply code " + rpyCode + ". - " + &lt;Hostname&gt;);
  }
  </code></pre>
  
  <p>Problem is at line  <code>ftpInstance.connect(&lt;HostName&gt;)</code>. An exception is been thrown Please look at the stack trace</p>
  
  <pre><code>java.lang.RuntimeException: java.net.SocketException: Malformed reply from SOCKS server
  at com.newgen.backend.Operation.call(Operation.java:91)
  at filetransfermanager.FileTransferManagerView$1.windowOpened(FileTransferManagerView.java:48)
  at java.awt.AWTEventMulticaster.windowOpened(Unknown Source)
  at java.awt.Window.processWindowEvent(Unknown Source)
  at javax.swing.JFrame.processWindowEvent(Unknown Source)
  at java.awt.Window.processEvent(Unknown Source)
  at java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$000(Unknown Source)
  at java.awt.EventQueue$1.run(Unknown Source)
  at java.awt.EventQueue$1.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue$2.run(Unknown Source)
  at java.awt.EventQueue$2.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.run(Unknown Source)
  
  Caused by: java.net.SocketException: Malformed reply from SOCKS server
  at java.net.SocksSocketImpl.readSocksReply(Unknown Source)
  at java.net.SocksSocketImpl.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at org.apache.commons.net.SocketClient.connect(SocketClient.java:171)
  at org.apache.commons.net.SocketClient.connect(SocketClient.java:192)
  at org.apache.commons.net.SocketClient.connect(SocketClient.java:285)
  at com.newgen.ftp.FTPInstance.getInstance(FTPInstance.java:38)
  at com.newgen.backend.Transport.&lt;init&gt;(Transport.java:58)
  at com.newgen.backend.Operation.call(Operation.java:81)
  ... 27 more
  </code></pre>
  
  <p>Above code is working fine in normal project but not in java web start.</p>
  
  <p>Any help is appreciated.
  Thanks.</p>