Hi,

I have tracked the issue down a little more now.

It appears the issue only happens when The machine your running ftpserver on 
has two network interfaces configured on different networks.  It looks like 
that the Window ftp client tries to open a passive connection and its this 
which is not working.

I have tried a number of things to get ftpserver to either ensure that it 
listens for the connection on the same IP that the request came in on, or to 
only use the same port, none of which appear to work.

For reference the code that I am using to setup the FTP server is below:

protected void init(int pPortNumber, String pPassiveIPAddress)
  throws FtpException
{
  FtpServerFactory tFtpServerFactory = new FtpServerFactory();
  ListenerFactory tListenerFactory = new ListenerFactory();
    
  if (pPassiveIPAddress != null)
  {
    DataConnectionConfigurationFactory tDataConnectionFactory = new 
DataConnectionConfigurationFactory();
    tDataConnectionFactory.setPassiveAddress(pPassiveIPAddress);
    tDataConnectionFactory.setPassiveExternalAddress(pPassiveIPAddress);
    tDataConnectionFactory.setPassivePorts(String.valueOf(pPortNumber));
    
tListenerFactory.setDataConnectionConfiguration(tDataConnectionFactory.createDataConnectionConfiguration());
  }
    
  tListenerFactory.setPort(pPortNumber);
  if (pPassiveIPAddress != null)
  {
    tListenerFactory.setServerAddress(pPassiveIPAddress);
  }
  tFtpServerFactory.addListener("default", tListenerFactory.createListener());

  tFtpletMap.put("default", new DefaultFtplet());
  tFtpServerFactory.setFtplets(tFtpletMap);

  mFtpServer = tFtpServerFactory.createServer();
  mFtpServer.start();
}

There is no NAT or anything going on with the machines in question its just 
connecting straight to an IP address (and the server is running Linux).

Is there a way to disable passive mode on apache ftpserver?

Thanks

Scott


On Monday 20 Apr 2015 10:01:31 Scott Neville wrote:
> Hi,
> 
> How do I get the logs of the server?
> 
> I have some more information now, we have used ftpserver on a number of 
> machines to play with, this issue just effects one machine (rather annoyingly 
> the one we want to use for production) and the issue is that any command that 
> lists files on the ftp server locks the thread in the FTP server and this 
> lock never appears to get released (ie had one thread left locked over the 
> whole weekend).
> 
> Thanks
> 
> Scott
> 
> On Friday 17 Apr 2015 00:38:58 David Latorre wrote:
> > Can you include the logs of both server and client?
> > 
> > 2015-04-16 16:07 GMT+02:00 Scott Neville <
> > scott.nevi...@bluestar-software.co.uk>:
> > 
> > > Hi,
> > >
> > > Trying to use Apache FTP server, I have it embedded in another
> > > application, and run it much like the example on the website.  I have a
> > > Ftplet which listens to all the commands writes them to a log for me and
> > > returns FtpletResult.DEFAULT.
> > >
> > > When the windows command line ftp client connects and runs a ls, this
> > > appears to executes an NLST command on the server.  Nothing is returned 
> > > and
> > > the user is disconnected, why does this happen?
> > >
> > > Any thoughts would be appriciated.
> > >
> > > Thanks
> > >
> > > Scott
> > >
> > > ---
> > > Scott Neville
> > > Software Developer, Bluestar Software
> > > Telephone: +44 (0)1256 882695
> > > Web site: www.bluestar-software.co.uk
> > > Facebook: www.facebook.com/bluestarsoftware
> > > Email: scott.nevi...@bluestar-software.co.uk
> > >
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > DISCLAIMER: This email message and any attachments is for the sole
> > > use of the intended recipient(s) and may contain confidential and
> > > privileged information.  Any unauthorised review, use, disclosure
> > > or distribution is prohibited. If you are not the intended recipient,
> > > please contact the sender by reply email and destroy all copies of
> > > the original message.
> > >
> > > The views expressed in this message may not necessarily reflect the
> > > views of Bluestar Software Ltd.
> > >
> > > Bluestar Software Ltd, Registered in England
> > > Company Registration No. 03537860, VAT No. 709 2751 29
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >
> > >
> > >
> > >
> > >
> 
-- 
Scott Neville
Software Developer, Bluestar Software
Telephone: +44 (0)1256 882695
Web site: www.bluestar-software.co.uk
Facebook: www.facebook.com/bluestarsoftware
Email: scott.nevi...@bluestar-software.co.uk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DISCLAIMER: This email message and any attachments is for the sole
use of the intended recipient(s) and may contain confidential and
privileged information.  Any unauthorised review, use, disclosure
or distribution is prohibited. If you are not the intended recipient,
please contact the sender by reply email and destroy all copies of
the original message.

The views expressed in this message may not necessarily reflect the
views of Bluestar Software Ltd.

Bluestar Software Ltd, Registered in England
Company Registration No. 03537860, VAT No. 709 2751 29
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




Reply via email to