tomcat-users mailing list archives

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

Scenario:

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"
          timestamp="true"/>
</Context>

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.

Issue:

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

Question:

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,
Vivek.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message