Phlogiston,
You should at least call "start" on FtpServer.  To retrieve FtpServer
"springContext".getBean("idOfYourServer") (  it could be get() , I don't
know right now) will do the trick for you. Although Spring should provide
other ways to do this, I start ftpserver with a ContextListener which
retrieves the bean and starts the server when the web context is created,
and stops the server when the context is destroyed.


If you're using several Spring configuration files I guess you'll just need
to declare all of them in your web.xml (I'm a complete ignorant regarding
Spring but it seems you need to declare a listener in web.xml that will load
your ApplicationContext. The procedure is in Spring docs anyway).

There are no bean elements in our xml files because Spring allows its XML
format to be extended via custom Schemas. So, when you declare a
<nio-listener> FtpServer code will interpret that as a bean definition with
class NioListener. You could, of course, define the elemente via <bean>
definitions but the custom namespace for FtpServer makes life so much better
for everyone :)






2008/10/8 Phlogiston Eight <[EMAIL PROTECTED]>

>
> I am trying to get FTPServer, and my FTPlets, to run in a Spring webapp.
>  I've read the Spring-setup documentation online, and taken the provided
> ftpd-typical.xml  Spring-config file and put it in with all of the other
> Spring-config files for other beans. All of the code and FTPServer/FTPlet
> libraries are already on the project classpath.
>
> However, when I clean-rebuilt, and ran the project on GlassFish, the
> FTPServer does not get constructed or start, and my FTPlets are not
> constructed or loaded, either.  When I try to connect with them again using
> my FTP client, the client cannot connect--the login times out with no
> response from FTPServer.  So in Spring, the Server and FTPlet are not being
> instantiated or loaded.
>
> When I tried ftpd-full.xml instead, same exact result.  I added the
> necessary <ftplet> node to it to register my ftplet.
>
> Should I be using ftpd-typical.xml directly as the only Spring bean-config
> file needed?  Or must I also write a bean-wiring XML doc for it?
>
> Also, what else do I have to do beside putting ftpd-typical.xml in there?
>  I mean--must I also write a Main class with a main() method which actually
> constructs the FTPServer instance and Ftplet instance? If so, I don't see
> any of the <bean>  nodes in ftpd-typical.xml or ftpd-full.xml  which Spring
> normally needs to instantiate, inject, and wire together the beans.  Do I
> have to write a Main class to instantiate everything?  How do I point to it
> in the Spring config files?
>
>
> _________________________________________________________________
> Want to do more with Windows Live? Learn "10 hidden secrets" from Jamie.
>
> http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

Reply via email to