tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: How can I prevent Quartz multiple execution after tomcat restart
Date Fri, 23 Oct 2009 11:02:31 GMT
On 23/10/2009 10:00, Elli Albek wrote:
> Where is your spring configuration file? Is it inside the war file?
>
> When you have two hosts, do you have the war file in both? If this is he case you may
deploy the entire war file twice. Generally a deployed war file can run only in one host.
If you run it in two hosts, you are deploying the entire war file twice. This will create
two instances of your quartz object.

Actually, now that Elli points that out...

> <Host name="localhost" appBase="webapps"
> unpackWARs="true" autoDeploy="false"
> xmlValidation="false" xmlNamespaceAware="false">
> </Host>
>
> <Host name="XXX.com"
> unpackWARs="true" autoDeploy="false" deployOnStartup="false"
> xmlValidation="false" xmlNamespaceAware="false">
> <Alias>www.XXX.com</Alias>
> <Context path="" docBase="/var/lib/tomcat55/webapps/xxx" reloadable="true">

...

> </Context>
> </Host>

The Host XXX.com doesn't have an appBase defined, so it might be using 
the default - which may mean that you're deploying the app twice, once 
as the ROOT application, and once under it's actual name.

You can check this by requesting: http://www.XXX.com/xxx, where "xxx" is 
the actual name of your app.

Either way, setting the Context in server.xml is _strongly_ discouraged.

You should:

1. set an appBase attribute in the XXX.com Host definition.

2. Remove the Context definition from server.xml

3. Remove the path & docBase attributes from the Context definition

4. Add a file "META-INF/context.xml" containing the Context definition 
to your web application.

5. rename your application directory "ROOT".


... and then let us know if the problem still occurs.

p

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


Mime
View raw message