[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
how to use overWriteExistingJobs property?  XML
Forum Index -> Quartz
Author Message
sonamzam

neo

Joined: 01/04/2010 01:26:41
Messages: 8
Offline

Hi,

I have set my quartz.properties with following configurations.
Code:
 org.quartz.plugin.jobInitializer.fileName = jobs1.xml,jobs2.xml
 org.quartz.plugin.jobInitializer.overWriteExistingJobs = true
 

But the jobs are not scheduled in the same order as I have specified the files.
i.e sometimes jobs2.xml is read before reading job1.xml.

Then whats the significance of the property 'overWriteExistingJobs' ?

If i want that the jobs in job1.xml to get overwritten if job2.xml has the same entry.
In other words, how can I enforce that file2 should always have higher precedence than file1? And if file2 contains same job as file1 then the jobs from file2 should overwrite file1 jobs.

please suggest.
thanks.
sonamzam

neo

Joined: 01/04/2010 01:26:41
Messages: 8
Offline


Solution found.
Quartz API use simple java.util.HashMap to store the JobFiles.
Changing that to java.util.LinkedHashMap solved the issue.
thanks anyways
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline

I've filed a ticket to make this simple change to the Quartz codebase itself.

james
sonamzam

neo

Joined: 01/04/2010 01:26:41
Messages: 8
Offline

Hi

I am getting an issue if in above scenario, job1.xml is in a jar file.
Its not able to read the job1.xml and throws SchedulerException saying
File named job1.xml does not exist.
Please suggest for the same.
sonamzam

neo

Joined: 01/04/2010 01:26:41
Messages: 8
Offline

In JobInitializationPlugin.java

Line 444 initialize() modified, classLoadHelper.getResource(getFileName()) replaced with getClass().getResource(getFileName())

This worked for me. But not sure if its the right way. Please suggest!!
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team