org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass

Stack Overflow | user734861 | 3 months ago
  1. 0

    Quartz job exists even after deleting it?

    Stack Overflow | 3 months ago | user734861
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
  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

    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
  5. 0

    Spring cron vs normal cron?

    Stack Overflow | 1 year ago | Paul
    java.lang.IllegalArgumentException: cron expression must consist of 6 fields (found 7 in 0 0 12 ? 1/1 SUN#1 *)

    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 expression '0 * * * * *' in the job class com.runnercard.RemoveUserCodeJob is not a valid cron expression

      at grails.plugins.quartz.config.TriggersConfigBuilder$_prepareCronTriggerAttributes_closure5.doCall()
    2. grails.plugins.quartz
      TriggersConfigBuilder.createNode
      1. grails.plugins.quartz.config.TriggersConfigBuilder$_prepareCronTriggerAttributes_closure5.doCall(TriggersConfigBuilder.groovy:204)
      2. grails.plugins.quartz.config.TriggersConfigBuilder$_closure1.doCall(TriggersConfigBuilder.groovy:216)
      3. grails.plugins.quartz.config.TriggersConfigBuilder.prepareCronTriggerAttributes(TriggersConfigBuilder.groovy:198)
      4. grails.plugins.quartz.config.TriggersConfigBuilder.createTrigger(TriggersConfigBuilder.groovy:78)
      5. grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:251)
      6. grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:244)
      6 frames
    3. com.runnercard
      RemoveUserCodeJob$__clinit__closure1.doCall
      1. com.runnercard.RemoveUserCodeJob$__clinit__closure1.doCall(TestJob.groovy:14)
      1 frame
    4. grails.plugins.quartz
      DefaultGrailsJobClass.<init>
      1. grails.plugins.quartz.config.TriggersConfigBuilder.build(TriggersConfigBuilder.groovy:51)
      2. grails.plugins.quartz.DefaultGrailsJobClass.evaluateTriggers(DefaultGrailsJobClass.java:57)
      3. grails.plugins.quartz.DefaultGrailsJobClass.<init>(DefaultGrailsJobClass.java:47)
      3 frames
    5. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:262)
      2. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      4. java.lang.Thread.run(Thread.java:745)
      4 frames