I want to do some job in my event(CrudRepository(IgniteRepository)) repository. But when I have a constructor even the empty constructor I get an exception.
public class UpdateStatusJob implements Job {
private TaskRepository TaskRepo;
// UpdateStatusJob(){}
UpdateStatusJob(TaskRepository taskRepo) throws
JobExecutionException
{
this.taskRepo= taskRepo;
}
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
System.out.println("Events!!!!!");
}
}
Exception :
org.quartz.SchedulerException: Job instantiation failed at org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(AdaptableJobFactory.java:45) at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:392) Caused by: java.lang.InstantiationException: com.mphasis.eventinsights.scheduler.UpdateStatusJob at java.lang.Class.newInstance(Class.java:427) at org.springframework.scheduling.quartz.AdaptableJobFactory.createJobInstance(AdaptableJobFactor y.java:58) org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(AdaptableJobFactory.java:41)
Caused by: java.lang.NoSuchMethodException: com.jp.tande.scheduler.UpdateStatusJob.() at java.lang.Class.getConstructor0(Class.java:3082) at java.lang.Class.newInstance(Class.java:412)
I need taskRepo to do some operations but failing call constructor.