Tomcat Initializing Servlet Twice

Uncategorized - No Comments » - Posted on May, 28 at 12:44 pm

A web application is configured using tomcat’s server.xml and the context.xml. There some configurations that cause web applications to initialize twice like

  1. Duplicate definition of context in context.xml and server.xml
  2. Bugs in tomcat launchers for eclipse that create duplicate context definitions
  3. Duplicate definition of contexts when defining multiple hosts

In my case I had a proper definition of the context and the problem was I was using a exploded war deployment format and my root directory was named .war , This was causing tomcat to treat it as a war file and a directory and initializing it twice.

The problem vanished after removing the .war extension to the directory. This happened to me on tomcat 6.0.16

Posted in Uncategorized | No Comments »

Leave a Reply