即使我为工作指定了名称,组和描述,也遇到了此错误,并且在调试器中我可以在detail变量中看到所有这些字段的值。

JobDetail detail = getDetail();
Trigger newTrigger = getTrigger( detail );
_quartzScheduler.scheduleJob( newTrigger );

JobDetail getDetail()
{
    JobBuilder jb = JobBuilder.newJob( LoadScheduleJob.class );

    jb = jb.withIdentity( JOB_LABEL +"Fred", "Group" );
    jb = jb.withDescription( "DD" );
    jb = jb.usingJobData( SCHEDULEID_MAP_KEY, Integer.valueOf( 22 ) );
    return jb.build();
}

Trigger getTrigger( JobDetail job ) throws ParseException
{
    CronTriggerImpl t = new CronTriggerImpl();//      TriggerBuilder.newTrigger().forJob( job ).
    t.setName( TRIGGER_LABEL + 22 );
    t.setGroup( "GroupJob" );
    t.setCronExpression( "1/7 * * ? * *" );
    return t;
}


我相信Job和JobDetail是同义词...对吗?

最佳答案

没关系。我看到我从不回避分配触发器的工作

08-25 02:25