what is the error i am getting in this program

Posted by Sudheep.Grandhe under Others on 11/11/2013 | Points: 10 | Views : 974 | Status : [Member] | Replies : 2
package com.quartzsche;

import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SimpleScheduleBuilder;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;
import org.quartz.impl.StdSchedulerFactory;

public class TestSchedule {
public static void main(String[] args) throws Exception {


JobDetail job = JobBuilder.newJob()
.withIdentity("dummyJobName", "group1").build();

Trigger trigger = TriggerBuilder
.newTrigger()
.withIdentity("dummyTriggerName", "group1")
.withSchedule(
SimpleScheduleBuilder.simpleSchedule()
.withIntervalInHours(1).repeatForever())
.build();


Scheduler scheduler = new StdSchedulerFactory().getScheduler();
scheduler.start();
scheduler.scheduleJob(job, trigger);

}
}


I have written a program using quartz scheduler for output to trigger every one hour...

When I run this program i am getting the following error:

Exception in thread "main" java.lang.IllegalArgumentException: Job class cannot be null.
at org.quartz.impl.JobDetailImpl.setJobClass(JobDetailImpl.java:307)
at org.quartz.JobBuilder.build(JobBuilder.java:103)
at com.quartzsche.TestSchedule.main(TestSchedule.java:16)


may I know what is this.

Best,
Sudheep.



Responses

Posted by: Bandi on: 11/11/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer
http://stackoverflow.com/questions/19445469/quartz-scheduler-not-return-values-method-executing-in-every-3-minutes

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Sudheep.Grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/11/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
check why the job object getting null...

JobDetail job = JobBuilder.newJob() 

.withIdentity("dummyJobName", "group1").build();


Refer
http://stackoverflow.com/questions/8445199/cannot-create-an-instance-of-jobdetail-interface-while-using-quartz

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Sudheep.Grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response