Mysterious Tomcat 4 start-up behavior

Discussions

Web tier: servlets, JSP, Web frameworks: Mysterious Tomcat 4 start-up behavior

  1. Mysterious Tomcat 4 start-up behavior (1 messages)

    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?

    I think it's related to this output to my console window:
    Starting service Tomcat-Standalone
    Apache Tomcat/4.0.1
    Starting service Tomcat-Apache
    Apache Tomcat/4.0.1

    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.
  2. 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.

    Matt