Announcement Announcement Module
Collapse
No announcement yet.
Spring and Quartz with unstable crontriggers. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring and Quartz with unstable crontriggers.

    Hi. I am having problems with unstable crontriggers in Quartz when it is integrated with Spring. The thing is that when I try to schedule a very simple job(it does practically nothing) with a crontrigger the times it gets executed at are very unstable. I have a globalJobListener to keep track of when it is executed and when I add a crontrigger with the following cronexpression:
    "0 * * * * ?"
    As far as I can understand this should trigger every minute. BUT, it doesn't. When it triggers it triggers at quite irregular intervals. This is an example of the timestamps from my logfile:

    18:54:48,902 INFO myPackage.JobLogger: Job with id 1
    changed state from NOT_AVAILABLE to CREATED
    18:55:00,168 INFO myPackage.JobLogger: Job with id 1
    changed state from CREATED to RUNNING
    18:55:00,184 INFO myPackage.JobLogger: Job with id 1
    changed state from RUNNING to FINISHED_SUCCESFULLY
    18:58:00,090 INFO myPackage.JobLogger: Job with id 1
    changed state from FINISHED_SUCCESFULLY to RUNNING
    18:58:00,121 INFO myPackage.JobLogger: Job with id 1
    changed state from RUNNING to FINISHED_SUCCESFULLY
    19:01:00,044 INFO myPackage.JobLogger: Job with id 1
    changed state from FINISHED_SUCCESFULLY to RUNNING
    19:01:00,059 INFO myPackage.JobLogger: Job with id 1
    changed state from RUNNING to FINISHED_SUCCESFULLY
    19:05:00,045 INFO myPackage.JobLogger: Job with id 1
    changed state from FINISHED_SUCCESFULLY to RUNNING
    19:05:00,061 INFO myPackage.JobLogger: Job with id 1
    changed state from RUNNING to FINISHED_SUCCESFULLY
    19:09:00,062 INFO myPackage.JobLogger: Job with id 1
    changed state from FINISHED_SUCCESFULLY to RUNNING
    19:09:00,109 INFO myPackage.JobLogger: Job with id 1
    changed state from RUNNING to FINISHED_SUCCESFULLY
    19:12:00,079 INFO myPackage.JobLogger: Job with id 1
    changed state from FINISHED_SUCCESFULLY to RUNNING
    19:12:00,110 INFO myPackage.JobLogger: Job with id 1
    changed state from RUNNING to FINISHED_SUCCESFULLY
    19:14:00,064 INFO myPackage.JobLogger: Job with id 1
    changed state from FINISHED_SUCCESFULLY to RUNNING
    19:14:00,095 INFO myPackage.JobLogger: Job with id 1
    changed state from RUNNING to FINISHED_SUCCESFULLY
    19:20:00,066 INFO myPackage.JobLogger: Job with id 1
    changed state from FINISHED_SUCCESFULLY to RUNNING
    19:20:00,113 INFO myPackage.JobLogger: Job with id 1
    changed state from RUNNING to FINISHED_SUCCESFULLY

    And like this unstability wasn't enough: Usually, after a while, the whole job gets deleted... I have put the log-level to DEBUG in my log4j-configuration and it does not generate any warnings, errors or so. Does anybody know what might cause this kind of behaviour?

    FYI: I create my job and trigger like this:
    long id =glob_list.jobCreated(new JobSpecification(SuperSimpleJob.class, new JobArgumentMap()));
    <code>
    JobDetail job = new JobDetail(""+id, DEFAULT_GROUP, SuperSimpleJob.class, false, true, true);
    job.setJobDataMap(new JobDataMap());
    CronTrigger trigg = new CronTrigger("trigger1", "defaultGroup", "0 * * * * ?");
    sched.scheduleJob(job, trigg);
    </code>

    Here, the sched is a reference to the scheduler I got through Spring.
    If you need any clarifications, I'll happily answer your questions.

    Regards,
    Ole
Working...
X