如何在Java中修复JobExecutionException?

时间:2013-03-13 14:01:45

标签: java listener

我的程序中有错误:

[DefaultQuartzScheduler_Worker-1] INFO org.quartz.core.JobRunShell - Job DEFAULT_GROUP.HelloJob threw a JobExecutionException: 
org.quartz.JobExecutionException: Testing Exception
    at CronTriggertes.HelloJob.execute(HelloJob.java:15)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:206)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:548)

我不知道如何解决它。

package CronTriggertes;
package CronTriggertes;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.util.Date;

public class HelloJob implements Job {
    public void execute(JobExecutionContext arg0) throws JobExecutionException{
        System.out.println("Hello World Quartz Scheduler with CronTrigger: " + new Date());                 throw new JobExecutionException("Testing Exception");
    }
}

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

从代码中删除throw new JobExecutionException("Testing Exception"); ...它与Job DEFAULT_GROUP.HelloJob threw a JobExecutionException

直接相关