Hi

Try Load on startup in web.xml configuration for Quartz .

I have done the same and have good results

The configuration is as PER QUARTZ API


<servlet>
         <servlet-name>
             QuartzInitializer
         </servlet-name>
         <display-name>
             Quartz Initializer Servlet
         </display-name>
         <servlet-class>
             org.quartz.ee.servlet.QuartzInitializerServlet
         </servlet-class>
         <load-on-startup>
             1
         </load-on-startup>
         <init-param>
             <param-name>config-file</param-name>
             <param-value>/some/path/my_quartz.properties</param-value>
         </init-param>
         <init-param>
             <param-name>shutdown-on-unload</param-name>
             <param-value>true</param-value>
         </init-param>
         <init-param>
             <param-name>start-scheduler-on-load</param-name>
             <param-value>true</param-value>
         </init-param>
     </servlet>


With regards
karthik

-----Original Message-----
From: Pid [mailto:p...@pidster.com]
Sent: Friday, October 23, 2009 4:33 PM
To: Tomcat Users List
Subject: Re: How can I prevent Quartz multiple execution after tomcat restart

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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


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

Reply via email to