You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Sisk, Brad" <BS...@ancorinfo.com> on 2008/09/12 18:54:26 UTC

Running FTPServer in a Web/Enterprise Application

The homepage for Apache FTPServer says it "can be integrated into Spring
(web) applications, in addition to just running embedded on a server.
It says you just register the FTPServer class in a <beans> element in
one of Spring's Deployment Descriptor XML files.  But there is no
documentation on doing this.

 

We need FTPServer to be run as part of a larger web or enterprise
application, running on Glassfish server. According to the homepage,
this is possible as long as said web or enterprise application is a
Spring App.

 

However, when I simply add a <bean> declaration to Spring's <beans>
list, in the XML file, and place FTPServer with all the other bean
classes for the app (WEB-INF/classes), Spring DOES successfully
instantiate an FTPServer bean on startup---however, any attempt to log
iinto the FTPServer from any FTP client fails. You can't even log into
it.  It doesn't reject the login-it just times out. Never returns.
Eventually, the entire Spring App then throws an Exception-a Stack
overflow relating to some thread pool.

 

I can rule out some bug in the source as the cause:  it runs perfectly
fine, handles all FTP commands properly, when you just right click and
select 'Run' on the FTPServer bean, directly, In other words, works fine
as a standalone JavaApplication-but not in a Spring (web) Application.
Uploads and Downloads perfectly when run as a standalone Java app.

 

Has anyone gotten it to work as a bean in a Spring or other Web
application (not merely embedded as a Java Application)?  Is it true it
can be done?  What must I do to set that up in Spring?

 

Thanks.

 

 


Re: Running FTPServer in a Web/Enterprise Application

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Fri, Sep 12, 2008 at 6:54 PM, Sisk, Brad <BS...@ancorinfo.com> wrote:
> The homepage for Apache FTPServer says it "can be integrated into Spring
> (web) applications, in addition to just running embedded on a server.
> It says you just register the FTPServer class in a <beans> element in
> one of Spring's Deployment Descriptor XML files.  But there is no
> documentation on doing this.

All XML config available on the site is Spring config files. You can
thus either use the custom <server> element or set it up as a standard
<bean>.

> We need FTPServer to be run as part of a larger web or enterprise
> application, running on Glassfish server. According to the homepage,
> this is possible as long as said web or enterprise application is a
> Spring App.

That's not true, FtpServer can be embedded using the Java API
directly, without any use of Spring, or within Spring (and any other
DI framework).

> However, when I simply add a <bean> declaration to Spring's <beans>
> list, in the XML file, and place FTPServer with all the other bean
> classes for the app (WEB-INF/classes), Spring DOES successfully
> instantiate an FTPServer bean on startup---however, any attempt to log
> iinto the FTPServer from any FTP client fails. You can't even log into
> it.  It doesn't reject the login-it just times out. Never returns.
> Eventually, the entire Spring App then throws an Exception-a Stack
> overflow relating to some thread pool.

Could you possibly provide your Spring application context files and
the code you use for starting FtpServer?

/niklas