tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vivek Mohan <>
Subject How to deploy my webapp as root context webapp without tomcat loading it twice?
Date Wed, 30 Nov 2005 11:02:16 GMT


I've a webapplication in my tomcat4 installation, called myWebapp.
I've configured it to be my root webapplication since I want users to
be able to access it using the url: "http:<host>:<port>". Here's a
snippet of my server.xml:

<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
autoDeploy="false" liveDeploy="false">

 <!-- Tomcat Root Context -->
       <Context path="" docBase="myWebapp" debug="0" reloadable="true">
         <Logger className="org.apache.catalina.logger.FileLogger"
                    prefix="localhost_myWebapp_log." suffix=".txt"

myWebapp has a init servlet which is loaded on startup. Besides doing
other things like instantiating db connection pool, this servlet
configures the log4j for the application logging.


When I start the tomcat server, I find, through logs of the application (and
of log4j), that the init servlet is executed twice.
Essentially, the webapp is loaded twice. This creates a problem with
myWebapp since the logger is configured twice (resulting in
cross-locks and hence Rolling fails).


I want to have myWebapp as the root context webapp in my tomcat
server. And I don't want to rename it to "ROOT". Is there a way by
which I can avoid tomcat from loading myWebapp twice?

Thanks in advance,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message