tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: Application gets started twice
Date Fri, 09 Oct 2009 16:19:56 GMT
> From: Maciej Zabielski []
> Subject: RE: Application gets started twice
> It is not that easy for me to get rid of Context element as when I do
> that, my mod_jk stops working

You probably don't want to get rid of the <Context> elements, but they really should
not be in server.xml, at least not on Tomcat 5.0 or newer.  Also, if you want a particular
webapp to be the default webapp for a <Host>, it should be named ROOT, not anything

> Mikolaj wrote: "move webapp to folder different than webapps and update
> docBase"
> Well, that alone did not fix my problem, I believe What is needed
> additionally is
> deployOnStartup=false - does this option set to true deployes only to
> default location? (not the one specified in context?)
> Chuck wrote: "docBase should point to some directory or .war file
> directly *underneath* the appBase directory."

I wasn't clear in that I was referring to the docBase determined for the webapp, whether that
be by explicit means, or derived from the location of the webapp.  In your original setup,
you ended up with both, but one of them was wrong.

> "When using automatic deployment, the docBase defined by an XML Context
> file should be outside of the appBase directory. If this is not the
> case difficulties may be experienced deploying the web application or
> the application may be deployed twice.

Which is exactly what you encountered.

> Taking all of that into account, I have created this HOST definition,
> and I copy unpacked WAR manually to docBase dir.

The manual unpacking is not necessary.

> 	<Context path="" docBase="/usr/local/apache-tomcat-
> 5.5.28/AlfrescoDocBase/alfresco"/>

Again, <Context> elements should not be in server.xml, and the default webapp for the
<Host> should be named ROOT.  Following standard practice makes things much easier;
if you were to do that, you could eliminate the <Context> element altogether, and simply
place your webapp in:

> 	<Context path="" docBase="/usr/local/apache-tomcat-
> 5.5.28/ShareDocBase/share"/>

Same comment as above; remove the <Context>, and place the webapp in:

> <VirtualHost *:80>
> 	ServerName
> 	DocumentRoot /usr/local/apache-tomcat-5.5.28/AlfrescoDocBase/alfresco
> 	#DirectoryIndex index.jsp

The above will need simplification, but I'm not an httpd person, so someone else will have
to tell you what they should be.

> Can I be sure that applications will not get started twice now?

If you follow standard practice, the applications will not be started twice.

 - Chuck

for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

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

View raw message