You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by ap...@arcor.de on 2012/02/20 11:29:53 UTC

Problems embedding Apache ftpserver into a webapp via Spring

Hi there,

I need an ftp server within my webapp (running on Tomcat), allowing users to upload data files that are imported into the database and then become visible in the webapp immediately.
According to the docs, Apache ftpserver is suitable for that job. And they say it's easily embeddable in any already spring-configured app of any kind.

But ... The embedded ftp server does not bind to the configured port. When trying to connect to it, I get a "Connection refused".

In my webapp's logs, I see a message that the ftpserver has read the SSL keystore and my user.properties. So I know it is loaded at all.

Running the ftpserver in standalone mode works on my development PC. It still works when I delete all 3rd party jars that come in the ftpserver download (aopalliance, logging, spring-beans, spring-context, spring-core) and replace them with the corresponding jars (slightly different version numbers) that are already used in my webapp. So I know it is not a jar version conflict.

But when I add the <server> from the standalone ftpd-typical.xml to my webapp's spring.xml (and correct the pathes to the files), all I get is the little log message mentioned above and the "Connection refused" on connect. No further error message, no further hint.
I added the <server> into the <beans> section where all of my service beans are configured. As the docs said you can add the <server> config _anywhere_ in the existing spring config, this should be a suitable place. But I'm not sure if it is really correct.

Dows anybody have an idea what the cause may be ?
Or at least where is a good point to start the investigation ?

Thanks a lot ...
Michael

Re: Problems embedding Apache ftpserver into a webapp via Spring

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Thu, Mar 22, 2012 at 10:40 AM,  <ap...@arcor.de> wrote:
> No ideas anyone ?

You leave little clues in your problem description. Would you be able
to isolate the problem (e.g. remove all your other beans from your
Spring config and anything else that might interfer) and also provide
a log on the debug level?

/niklas

Re: Problems embedding Apache ftpserver into a webapp via Spring

Posted by ap...@arcor.de.
No ideas anyone ? 

Thanks a lot ...
Michael


----- Original Nachricht ----
Von:     apache-user@arcor.de
An:      bryan.hunt@sentimentmetrics.com, apache-user@arcor.de, ftpserver-users@mina.apache.org
Datum:   21.02.2012 09:55
Betreff: Aw: Re: Problems embedding Apache ftpserver into a webapp via
 Spring

> Hi Bryan,
> 
> Thank you very much for the reply,
> but the problem is something different. The port in my config is 2121.
> Furthermore, if that was the problem, I would not have been able to start
> the ftpserver in standalone mode, which I did also as non-root user.
> 
> Thanks a lot ...
> Michael
> 
> ----- Original Nachricht ----
> Von:     Bryan Hunt <br...@sentimentmetrics.com>
> An:      apache-user@arcor.de, ftpserver-users@mina.apache.org
> Datum:   20.02.2012 16:02
> Betreff: Re: Problems embedding Apache ftpserver into a webapp via Spring
> 
> > On Mon, 20 Feb 2012 11:29:53 +0100 (CET), apache-user@arcor.de wrote:
> > 
> > Only root can bind below 1024, the trick on Linux is to do something
> > like this.
> > 
> > http://mina.apache.org/ftpserver/ftpserver-and-port-21-on-linux.html
> > 
> > sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 21 -j REDIRECT
> > --to-ports 60021
> > 
> 

Aw: Re: Problems embedding Apache ftpserver into a webapp via Spring

Posted by ap...@arcor.de.
Hi Bryan,

Thank you very much for the reply,
but the problem is something different. The port in my config is 2121.
Furthermore, if that was the problem, I would not have been able to start the ftpserver in standalone mode, which I did also as non-root user.

Thanks a lot ...
Michael

----- Original Nachricht ----
Von:     Bryan Hunt <br...@sentimentmetrics.com>
An:      apache-user@arcor.de, ftpserver-users@mina.apache.org
Datum:   20.02.2012 16:02
Betreff: Re: Problems embedding Apache ftpserver into a webapp via Spring

> On Mon, 20 Feb 2012 11:29:53 +0100 (CET), apache-user@arcor.de wrote:
> 
> Only root can bind below 1024, the trick on Linux is to do something
> like this.
> 
> http://mina.apache.org/ftpserver/ftpserver-and-port-21-on-linux.html
> 
> sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 21 -j REDIRECT
> --to-ports 60021
>