开发者

Why am i getting "Trigger's related Job's name cannot be null" error in quartz

I'm getting this error, even though i'm specifying a name, group and description for my job, and in the debugger i can see values for all these fields in the detail variable.

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 ) throw开发者_Python百科s ParseException
{
    CronTriggerImpl t = new CronTriggerImpl();//      TriggerBuilder.newTrigger().forJob( job ).
    t.setName( TRIGGER_LABEL + 22 );
    t.setGroup( "GroupJob" );
    t.setCronExpression( "1/7 * * ? * *" );
    return t;
}

I believe Job and JobDetail are synonymous...Is that correct?


Never mind. I see i never got around to assigning the trigger's job

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜