I have a servlet with a value of 10 for load-on-startup. When Tomcat starts, init() gets called. Then, when I hit the servlet with the browser, init() gets called again. Why does that happen?
- Posted by: Ignatius Reilly
- Posted on: November 30 2001 20:06 EST
I think it's related to this output to my console window:
Starting service Tomcat-Standalone
Starting service Tomcat-Apache
What's this? I can't find any documentation about the existence of two processes, each of which apparently calls my servlet's init() method.
Take a look through the logs generated by Tomcat. Most likely your servlet is not being initialized properly. Tomcat will attempt to reload the servlet when a second request is generated to the servlet.