{"record":{"id":"ed387e19a6f48acb","repo":"quarkusio/quarkus","slug":"schedulerexception-while-scheduling-job-no-messag","errorCode":null,"errorMessage":"SchedulerException while scheduling job (no message)","messagePattern":"SchedulerException while scheduling job \\(no message\\)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java","lineNumber":1063,"sourceCode":"                }, invoker,\n                SchedulerUtils.parseOverdueGracePeriod(scheduled, defaultOverdueGracePeriod),\n                runtimeConfig.runBlockingScheduledMethodOnQuartzThread(), true, null, description);\n        QuartzTrigger existing = scheduledTasks.putIfAbsent(scheduled.identity(), quartzTrigger);\n\n        if (existing != null) {\n            throw new IllegalStateException(\"A job with this identity is already scheduled: \" + scheduled.identity());\n        }\n\n        try {\n            if (oldTrigger != null) {\n                scheduler.rescheduleJob(trigger.getKey(), trigger);\n                LOGGER.debugf(\"Rescheduled job definition with config %s\", scheduled);\n            } else {\n                scheduler.scheduleJob(jobDetail, trigger);\n                LOGGER.debugf(\"Scheduled job definition with config %s\", scheduled);\n            }\n        } catch (SchedulerException e) {\n            throw new IllegalStateException(e);\n        }\n        return quartzTrigger;\n    }\n\n    /**\n     * @see Nonconcurrent\n     */\n    @DisallowConcurrentExecution\n    static class NonconcurrentInvokerJob extends InvokerJob {\n\n        NonconcurrentInvokerJob(QuartzTrigger trigger, Vertx vertx) {\n            super(trigger, vertx);\n        }\n\n        @Override\n        boolean awaitResult() {\n            return true;\n        }","sourceCodeStart":1045,"sourceCodeEnd":1081,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java#L1045-L1081","documentation":"When a scheduled job definition is registered programmatically, QuartzSchedulerImpl calls scheduler.scheduleJob(jobDetail, trigger) (or reschedules). If the underlying Quartz Scheduler throws a SchedulerException — e.g. the scheduler is not started/shut down, the JobDetail/Trigger pair is invalid, or the job store rejected the operation — it is wrapped in an IllegalStateException and rethrown to the caller of the public scheduling API.","triggerScenarios":"Calling QuartzSchedulerImpl.scheduleJob (or rescheduling an existing job definition) when the Quartz scheduler rejects the JobDetail/Trigger: scheduler already shut down, duplicate job key with incompatible trigger, or a persistent job store (JDBC) failing to persist the job.","commonSituations":"Registering jobs during startup after the scheduler stopped due to another startup failure; JDBC job store whose datasource is down or misconfigured; scheduling two jobs with the same identity but conflicting settings; live-reload reconfiguration racing a scheduler shutdown.","solutions":["Check the wrapped SchedulerException's message/cause (IllegalStateException.getCause()) for the real Quartz failure reason","Verify the job store configuration (quarkus.quartz.store-type); for jdbc-store confirm the datasource is configured and reachable at startup","Ensure you do not schedule jobs manually while the Quarkus scheduler is shut down or still starting","If rescheduling, make sure the job identity and trigger definition match what is stored, or delete the job first","Fix any earlier startup failure that caused the scheduler to stop before this job was registered"],"exampleFix":"// before\nscheduler.scheduleJob(jobDetail, trigger); // throws IllegalStateException wrapping SchedulerException\n// after\ntry {\n    scheduler.scheduleJob(jobDetail, trigger);\n} catch (IllegalStateException e) {\n    LOG.errorf(e.getCause(), \"Failed to schedule job %s\", jobDetail.getKey());\n}","handlingStrategy":"try-catch","validationCode":"// Before scheduling, verify the scheduler is not shutdown and the job key is free\nScheduler s = ...; // obtained from the running Quartz scheduler\nif (s.isShutdown()) { throw new IllegalStateException(\"Scheduler already stopped\"); }\nif (s.checkExists(jobKey)) { s.deleteJob(jobKey); }","typeGuard":null,"tryCatchPattern":"try {\n    scheduler.scheduleJob(jobDetail, trigger);\n} catch (IllegalStateException e) {\n    // cause is the SchedulerException\n    Throwable cause = e.getCause();\n    LOG.errorf(cause, \"Quartz rejected scheduling of %s\", jobDetail.getKey());\n}","preventionTips":["Never schedule after application shutdown begins","Use unique job identities and delete before re-registering","Validate cron expressions before building triggers","Keep JDBC job store datasources available during startup"],"tags":["quarkus","quartz","scheduling","illegal-state","job-store"],"backgroundTag":"scheduler-schedule-job-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}