-
Apr 28th, 2009, 05:58 AM
#1
Quartz - Tomcat multiple/duplicate job executions
Hi,
Not sure if this should go here or in some Tomcat forum. Apologies if it's not the right place.
I have a Tomcat 6.0.14 hosting 2 applications. Both are using Spring.
One of the two is using Quartz through Spring.
Quartz version is 1.5.0.
Now depending on the Host configuration the jobs are executed various times.
I've been testing various configs in Tomcat and these are my findings.
-------------------------------------------------------------------------
1 Host elements (the one using Quartz)
0 Context elements 1 job execution
1 Host elements (the one using Quartz)
1 Context elements 2 job executions
2 Host elements
1 Context elements 2 job executions
2 Host elements
2 Context elements 3 job executions
-------------------------------------------------------------------------
I don't know how exactly to interpret this or troubleshoot this problem. Has anyone had a similar problem.
I'm using the default quartz configuration that comes with the quartz jar.
I can post config files if needed.
Any help appreciated.
Stelios
-
Apr 28th, 2009, 07:45 AM
#2
Quartz Scheduler is being started multiple times
After checking the logs I found this line QuartzScheduler.start(399) is being printed twice or three times etc. depending on the virtual hosts configuration
Adding autoDeploy="false" deployOnStartup="false" to the host
element will solve this. Values are true by default.
Why is this happening in the first place though...?
-
Apr 28th, 2009, 08:14 AM
#3
Tomcat issue
After reading more of Tomcat's documentation it seems this is a Tomcat specific on how it deploys applications.
For reference: http://tomcat.apache.org/tomcat-6.0-...n%20Deployment
-
Sep 16th, 2009, 09:03 PM
#4
Tomcat and Quartz dupliacte jobs
I had same problem and followed your suggestions. However, I still have same issue.
Appreaciate your help.
Tony
Here are my configurations:
<bean id="commandCenterIncidentUpdate" class="org.springframework.scheduling.quartz.Metho dInvokingJobDetailFactoryBean">
<property name="targetObject" ref="updateCCIncident" />
<property name="targetMethod" value="updateCCIncidents" />
<property name="concurrent" value="false" />
</bean>
<bean id="updateCCIncident" class="scheduling.UpdateCCIncidents">
<property name="cprService">
<ref bean="CPRService" />
</property>
</bean>
<bean id="cronIncidentUpdateTrigger"
class="org.springframework.scheduling.quartz.CronT riggerBean">
<property name="jobDetail" ref="commandCenterIncidentUpdate"/>
<property name="cronExpression" value="0 0,15,30,45, * * * ?" />
</bean>
<bean id="quartzShedulerFactoryBean" class="org.springframework.scheduling.quartz.Sched ulerFactoryBean">
<property name="triggers">
<list>
<ref bean="cronIncidentUpdateTrigger" />
</list>
</property>
<property name="applicationContextShedulerContextKey" value="applicationContext"/>
<property name="waitForJobsToCompleteOnShutdown" value="true"/>
</bean>
Server.xml
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false"
deployOnStartup="false"
xmlValidation="false" xmlNamespaceAware="false">
-
Sep 17th, 2009, 03:53 AM
#5
Hi,
Unfortunately I don't have access to those configuration files any longer since
it's an old company I worked for.
Best thing is to check the Tomcat documentation. I hope the link I've posted
in this thread will help.
Stelios
-
Sep 17th, 2009, 07:33 PM
#6
Stelios,
Thanks. I fxed the problem. The problem is we load applicationContext three times due to wrong Spriing configuration.
Tony
-
Jun 8th, 2010, 03:06 PM
#7
multiple applicationContexts in tomcat app
Hi,
I'm seeing the same problem that spring context is being loaded twice in tomcat and cannot figure out what is causing it. For example i see two sets of quartz threadpool. Can someone please point me to where to look into?
Ramin
-
Jun 8th, 2010, 05:51 PM
#8
this had something to do with the autodeploy feature of tomcat if I remember well, have a look there. There are to properties that I've changed but it's been ages, one of the them was autodeploy and the other something to do with war deployment. Both in the tomcat config. If you find a solution please post it. This thread seems to be getting resurrected once in a while....
-
Jun 9th, 2010, 12:11 PM
#9
Well, I played with autoDeploy and deployOnStartUp and nothing helped. What seems to be happening is that tomcat starts up and i can see that there is one instance of my app alive, as soon as i access the app (through its context "/foo") then suddenly the second instance pops up and I fail to see why the first or the second would/should be there in the first place. i have not configure the ROOT instance at all, otherwise i would have said that i'm having these instances one for "/" and one for "/foo" context.
-
Jun 10th, 2010, 09:23 AM
#10
OK, for the ones that are having the problem i was having, this was my solution thanks to Alistair's blog:
http://codebrane.com/blog/?p=249
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules