Most containers, I thought, loaded their servlets on startup, but perhaps Tomcat 4 doesn't. If you set your <load-on-startup> element in <servlet> to a non-zero value, it will call the init method on app startup.

Something like below in web.xml:

<servlet>
   <servlet-name>DOOOOD</servlet-name>
   <servlet-class>foo.bar.dood.DoodServlet</servlet-class>
   <load-on-startup>1</load-on-startup>
</servlet>

-Adam

John Kristian wrote:

Can you recommend a way to load services.xml and expose services during
the deployment of a web application that contains XFire?

XFireConfigurableServlet does this work when the servlet container calls
Servlet.init.  But this doesn't happen until the first servlet request
(in Tomcat 4).  I'd prefer to initialize XFire during deployment (that
is, when the container calls ServletContextListener.contextInitialized).
The problem with lazy initialization is that it takes several seconds,
which is long enough to cause the client to time out and give up.

Can I configure Tomcat 4 to initialize the servlet proactively?

- John Kristian


Reply via email to