Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Startup servlet init() called twice  RSS feed

 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
I have a Servlet in my web-application that must be loaded at startup. This has been specified using the load-on-startup tag for the Servlet in web.xml.
The problematic part is that the init() of this servlet is getting called twice by tomcat during startup and this happens only when my application context "path" (specified in server.xml) is blank("").
Based on inputs from earlier posts here and other forums I also commented the Invoker servlet mappings from server.xml and aded the attribute "isInvokerEnabled=false" to the application context but to no avail.
Please note that the servlet definition appears only once in my deployment descriptor. There is absolutely no reason why it should get called twice. I am using Tomcat4.1.18.
Any thoughts? Thanks for your time.
[ June 25, 2003: Message edited by: Debashish Chakrabarty ]
 
Bhushan Jawle
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not very sure about "isInvokerEnable=false", but isn't container free to create more than one instance of your servlet to handle multiple requests simultaneously ?
 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right Bhushan, but why it doesn't happen if I have a context path defined (say path="myApp"). Secondly why create only two instances why not more. I am not exactly sure but should the container create instances for the pool at startup for such servlets or during runtime depending on the client requests for it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!