The way you can do it is as follow: - write an init method in your class representing your service that you don't deploy as web service method - write a Servlet class that will call the init method of your service class - in the WEB-INF/web.xml config file add a servlet entry for the previous servlet.
It has the effect that each time your starts your servlet container (tomcat for instance) it will initialized your service.
Hope it helps. Patrick.
Mark D. Hansen wrote:
I've got a SOAP service that takes a long time to initialize because it is creating a instance of a relational dabatase, opening a JDBC connection, etc.
This initialization gets done in a static initialization block in the service - so it only happens once. But, it seems like Axis doesn't instantiate an instance of the service class until it gets invoked for the first time.
The problem I have is that I get a socket time-out exception on the client while it is waiting for the init stuff to finish the first time the service is called.
Is there any way that I can force the service to initialize *before* it gets called. Like when the AxisServlet starts up? Or when the service is deployed through the AdminClient?
Thanks for your help,
Mark