File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Run Servlet on deployment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Run Servlet on deployment" Watch "Run Servlet on deployment" New topic

Run Servlet on deployment

Ron Patel

Joined: Apr 11, 2004
Posts: 18

I'm very perplexed on using servlets for my Web Service. I find that Application Servers do not call init() on my servlet until the very first time an RPC call is received.

This seems very limited to me. My Web Services require background threads to be running processing data while waiting for users to make RPC calls.

Is there any way to force the Application Server to call init on my Web Service at deployment time and not at the time the very first RPC call is received?

Peer Reynders

Joined: Aug 19, 2005
Posts: 2933
Have tried "load-on-startup" in your web.xml deployment descriptor?
Ron Patel

Joined: Apr 11, 2004
Posts: 18
This works fine for the Axis servlet. I failed to mention that I am using Apache Axis as my Web Service Engine. How do I tell Apache Axis to call init on my Web Service on startup?
I agree. Here's the link:
subject: Run Servlet on deployment
It's not a secret anymore!