quartz-scheduler

JAVA: Run the cron job task even schedule has come

主宰稳场 提交于 2019-12-23 05:26:25
问题 I already checked here but seems no solution given. Here is my problem. I have a cron job in my seam project which is written with jboss async. It runs at 3am everyday. However last night, the application needed to reboot before that time. Past 3am when the application started. The task set to run every 3am but did not run. In the code, the final expiration is set to 12/31/9999. Technically speaking, this will assume that it is already done. Is there any chance to still run that job even past

Running a Quartz job with Java class name stored in database

醉酒当歌 提交于 2019-12-23 04:33:13
问题 I have a two jobs in Quartz which will run perfetly well but I find I have to use code like: jd = new JobDetail(sj.getJobName(), scheduler.DEFAULT_GROUP, PollJob.class); ct = new CronTrigger(sj.getJobTrigger(), scheduler.DEFAULT_GROUP, "0 20 * * * ?"); scheduler.scheduleJob(jd, ct); I have to hardcode PollJob.class to run the job and sj is an object read from the database containing PollJob's details. But I would like to set PollJob.class from the database as well. I've tried casting to a

quartz spring cron trigger fire immediately

核能气质少年 提交于 2019-12-23 03:51:39
问题 I have a spring application that uses quartz cron trigger. I have given the following for frequency 0 0/20 * * * ?.....once every 20 min. But i want the first one to run immediately. Right now, when I start the application, it runs after 20 min. I was hoping it would run asap and then after 20 min. Thanks in advance. 回答1: You don't need CRON expression (and Quartz at all!) to run given code every 20 minutes. Just use fixed rate (Spring built-in): @Scheduled(fixedRate=20 * 60 * 1000) That's it

Quartz properties does not trigger Quartz Job

两盒软妹~` 提交于 2019-12-23 03:45:44
问题 I'm using Quartz 2.1.3. My quartz.properties : #=================================================== # Configure the Job Initialization Plugin #=================================================== org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin org.quartz.plugin.jobInitializer.fileNames = quartz-jobs.xml org.quartz.plugin.jobInitializer.failOnFileNotFound = true org.quartz.plugin.jobInitializer.scanInterval = 10 org.quartz.plugin.jobInitializer

Quartz start at a specific time and run at specific interval

陌路散爱 提交于 2019-12-23 02:53:39
问题 I have been trying to come up with a cron expression to start a job at 8.30am and run every 30 mins until midnight and restart at 8.30am next day. I came up with following expression but only thing it lacks is starting at 8.30am. Rather than starting at 8.30 it starts at 8.00. 0 0/30 8/1 * * ? Is it even possible to do what I'm trying to do? I'll be using java quartz2.x.x 回答1: It seems to be not possible in single expression. There is good link, to create your cron expression, you may refer

Altering Quartz Job Schedule

萝らか妹 提交于 2019-12-23 01:37:32
问题 I'm looking into scheduling my application with Quartz, but in all cases, the job trigger seems to be a one-time activity, and changes to the trigger need the application to be re-deployed to take effect. Is there any way I can have the job trigger check for changes to the job schedule without having to redeploy the code? Thanks, 回答1: Trap some user-driven event, like updating a text value, for example a cron-string to schedule a job Locate and unschedule/delete the old job and trigger.

Shutdown Quartz scheduler

天涯浪子 提交于 2019-12-22 18:15:32
问题 I have Quartz scheduler in my web application with Guice. I followed code found here. Everything works fine, but I can't figure out how to shutdown scheduler. My context listener looks like this: public class MyAppContextListener extends GuiceServletContextListener{ @Override protected Injector getInjector() { return Guice.createInjector(new QuartzModule(), new MyAppServletModule()); } } And Quartz module looks like this: public class QuartzModule extends AbstractModule { @Override protected

quartz Fire Job immediately doesn't work

谁都会走 提交于 2019-12-22 18:01:33
问题 I integrated quartz 2 and spring 4 with maven and java annotation ( using servlet 3 ), also i am using tomcat 7 maven plugin for deploying my project,my quartz Configuration class like as below : and my job class define simply like as below : then i use the quartz Scheduler for using fire my job trigger immediately as below : but my problem is : when i call fireNow methode with "job1" , "mygroup" parameters nothing happens and my job1 do not call immediately and don't print anything in

Can't access any bean from Quartz Job in Grails

老子叫甜甜 提交于 2019-12-22 13:57:09
问题 I am using services in grails and getting and setting data from services in controllers and there is no problem. I know how to use it... But this problem I can't solve, please help me if you know what is going wrong. There is a QuartzJob, I schedule from service from controller... Data is stored in PostgreSQL. Using last version of all plugins and 2.3.3 Grails. In code below I just want to print nickname, but I can't get service. Tried to get bean, def grailsApplication but with no success.

Quartz JobDataMap doesn't work for not-primitive types

大兔子大兔子 提交于 2019-12-22 10:54:58
问题 I have a following problem with Quartz JobDataMap . I expect that when using simple Quartz Job and passing not-primitive object (e.g. instance of StringBuilder ) into JobDateMap , method execute (from my job) should be always invoked with different copy of objected I put. Unfortunately I always get instance of object I put into JobDateMap (like it would be a StatefulJob). In bellow example I expect to get single '*' in every invocation while I get one more '*' every time. public class MyJob