java.lang.IllegalArgumentException: Cron time expression cannot be null

Atlassian JIRA | Brad Baker [Atlassian] | 9 years ago
  1. 0

    The code in SchedulerUtil has design fault such that if any jobs are invalid and throw exceptions and the scheduler is never started. {code} public void initializeAndStart(Scheduler scheduler) { SchedulerConfig config = new SchedulerConfig(); try { Map jobs = config.getJobs(); for (Iterator iterator = config.getTriggers().iterator(); iterator.hasNext();) { Trigger trigger = (Trigger) iterator.next(); scheduler.scheduleJob((JobDetail) jobs.get(trigger.getFullJobName()), trigger); } scheduler.start(); log.info("The scheduler has been launched."); } catch (Exception e) { log.error(e, e); } } {code} As you can see the call to scheduler.start() is only made if all defined jobs can be started. A customer had a problem where they had "null cron" job entries and hence an exception was thrown but then because the scheduler doesnt start, none of their services ran from that point forward. For example there mail queue service didnt run. We need to improve the code design to start the service regardless of job triggering failures. Here is the strack trace {noformat} [com.atlassian.scheduler.SchedulerUtil] java.lang.IllegalArgumentException: Cron time expression cannot b e null java.lang.IllegalArgumentException: Cron time expression cannot be null at org.quartz.CronTrigger.setCronExpression(CronTrigger.java:672) at org.quartz.CronTrigger.<init>(CronTrigger.java:589) at com.atlassian.scheduler.OfBizJobStore.initialise(OfBizJobStore.java:111) at com.atlassian.scheduler.OfBizJobStore.storeJob(OfBizJobStore.java:174) at com.atlassian.scheduler.OfBizJobStore.storeJob(OfBizJobStore.java:168) at com.atlassian.scheduler.OfBizJobStore.storeJobAndTrigger(OfBizJobStore.java:161) at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:576) at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:221) at com.atlassian.scheduler.SchedulerUtil.initializeAndStart(SchedulerUtil.java:30) at com.atlassian.scheduler.SchedulerLauncher.contextInitialized(SchedulerLauncher.java:30) at com.atlassian.jira.scheduler.JiraSchedulerLauncher.contextInitialized(JiraSchedulerLauncher.java:30) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763) {noformat}

    Atlassian JIRA | 9 years ago | Brad Baker [Atlassian]
    java.lang.IllegalArgumentException: Cron time expression cannot be null
  2. 0

    The code in SchedulerUtil has design fault such that if any jobs are invalid and throw exceptions and the scheduler is never started. {code} public void initializeAndStart(Scheduler scheduler) { SchedulerConfig config = new SchedulerConfig(); try { Map jobs = config.getJobs(); for (Iterator iterator = config.getTriggers().iterator(); iterator.hasNext();) { Trigger trigger = (Trigger) iterator.next(); scheduler.scheduleJob((JobDetail) jobs.get(trigger.getFullJobName()), trigger); } scheduler.start(); log.info("The scheduler has been launched."); } catch (Exception e) { log.error(e, e); } } {code} As you can see the call to scheduler.start() is only made if all defined jobs can be started. A customer had a problem where they had "null cron" job entries and hence an exception was thrown but then because the scheduler doesnt start, none of their services ran from that point forward. For example there mail queue service didnt run. We need to improve the code design to start the service regardless of job triggering failures. Here is the strack trace {noformat} [com.atlassian.scheduler.SchedulerUtil] java.lang.IllegalArgumentException: Cron time expression cannot b e null java.lang.IllegalArgumentException: Cron time expression cannot be null at org.quartz.CronTrigger.setCronExpression(CronTrigger.java:672) at org.quartz.CronTrigger.<init>(CronTrigger.java:589) at com.atlassian.scheduler.OfBizJobStore.initialise(OfBizJobStore.java:111) at com.atlassian.scheduler.OfBizJobStore.storeJob(OfBizJobStore.java:174) at com.atlassian.scheduler.OfBizJobStore.storeJob(OfBizJobStore.java:168) at com.atlassian.scheduler.OfBizJobStore.storeJobAndTrigger(OfBizJobStore.java:161) at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:576) at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:221) at com.atlassian.scheduler.SchedulerUtil.initializeAndStart(SchedulerUtil.java:30) at com.atlassian.scheduler.SchedulerLauncher.contextInitialized(SchedulerLauncher.java:30) at com.atlassian.jira.scheduler.JiraSchedulerLauncher.contextInitialized(JiraSchedulerLauncher.java:30) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763) {noformat}

    Atlassian JIRA | 9 years ago | Brad Baker [Atlassian]
    java.lang.IllegalArgumentException: Cron time expression cannot be null
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    IE6,HTTP Negotiate, Spnego token, Kerberos, Windows2000

    Oracle Community | 1 decade ago | 843811
    java.lang.IllegalArgumentException: Authentication time of ticket cannot be null
  5. 0

    GSS-API Java Gurus

    Oracle Community | 1 decade ago | 843811
    java.lang.IllegalArgumentException: Authentication time of ticket cannot be null

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Cron time expression cannot be null

      at org.quartz.CronTrigger.setCronExpression()
    2. quartz
      CronTrigger.<init>
      1. org.quartz.CronTrigger.setCronExpression(CronTrigger.java:672)
      2. org.quartz.CronTrigger.<init>(CronTrigger.java:589)
      2 frames
    3. com.atlassian.scheduler
      OfBizJobStore.storeJobAndTrigger
      1. com.atlassian.scheduler.OfBizJobStore.initialise(OfBizJobStore.java:111)
      2. com.atlassian.scheduler.OfBizJobStore.storeJob(OfBizJobStore.java:174)
      3. com.atlassian.scheduler.OfBizJobStore.storeJob(OfBizJobStore.java:168)
      4. com.atlassian.scheduler.OfBizJobStore.storeJobAndTrigger(OfBizJobStore.java:161)
      4 frames
    4. quartz
      StdScheduler.scheduleJob
      1. org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:576)
      2. org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:221)
      2 frames
    5. com.atlassian.scheduler
      SchedulerLauncher.contextInitialized
      1. com.atlassian.scheduler.SchedulerUtil.initializeAndStart(SchedulerUtil.java:30)
      2. com.atlassian.scheduler.SchedulerLauncher.contextInitialized(SchedulerLauncher.java:30)
      2 frames
    6. com.atlassian.jira
      JiraSchedulerLauncher.contextInitialized
      1. com.atlassian.jira.scheduler.JiraSchedulerLauncher.contextInitialized(JiraSchedulerLauncher.java:30)
      1 frame
    7. Glassfish Core
      StandardContext.listenerStart
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
      1 frame