You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Afaik, the GetJobDetail() is supposed to return null for invalid jobs. In 3.1.0 (and 4.0.0-preview.3) the GetJobDetail() method raises exceptions instead of returning null in a few cases. While this can be handled when calling GetJobDetails() directly, it causes some internal errors during scheduler initialization as well.
Scenarios: Job class no longer exists
After removing a job class or changing its class name and restarting the scheduler, the GetJobDetail() raises an exception with the following error.
Quartz.JobPersistenceException: Job class cannot be null.
---> System.ArgumentException: Job class cannot be null.
at Quartz.Impl.JobDetailImpl.set_JobType(Type value)
at Quartz.Impl.JobDetailImpl..ctor(JobKey key, Type jobType, String description, Boolean isDurable, Boolean requestsRecovery, JobDataMap jobDataMap, Nullable`1 disallowConcurrentExecution, Nullable`1 persistJobDataAfterExecution)
at Quartz.JobBuilder.Build()
at Quartz.Spi.MongoDbJobStore.Models.JobDetail.GetJobDetail()
at Quartz.Spi.MongoDbJobStore.MongoDbJobStore.ReplaceTriggerInternal(TriggerKey triggerKey, IOperableTrigger newTrigger)
at Quartz.Spi.MongoDbJobStore.MongoDbJobStore.ReplaceTrigger(TriggerKey triggerKey, IOperableTrigger newTrigger, CancellationToken token)
--- End of inner exception stack trace ---
at Quartz.Spi.MongoDbJobStore.MongoDbJobStore.ReplaceTrigger(TriggerKey triggerKey, IOperableTrigger newTrigger, CancellationToken token)
at Quartz.Core.QuartzScheduler.RescheduleJob(TriggerKey triggerKey, ITrigger newTrigger, CancellationToken cancellationToken)
at Quartz.Xml.XMLSchedulingDataProcessor.ScheduleJobs(IScheduler sched, CancellationToken cancellationToken)
at Quartz.ServiceCollectionSchedulerFactory.InitializeScheduler(IScheduler scheduler, CancellationToken cancellationToken)
at Quartz.ServiceCollectionSchedulerFactory.GetScheduler(CancellationToken cancellationToken)
JobDataMap difference between v3 and v4
An empty JobDataMap is stored as "{}" in v4.0.0-preview.3 and null in v3.1.0. Because of this migrating from v3.1.0 to v4.0.0-preview.3 with existing jobs in the mongodb store causes the following error:
Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'newJobDataMap')
at Quartz.JobBuilder.SetJobData(JobDataMap newJobDataMap)
at Quartz.Spi.MongoDbJobStore.Models.JobDetail.GetJobDetail()
at Quartz.Spi.MongoDbJobStore.MongoDbJobStore.RetrieveJob(JobKey jobKey, CancellationToken token)
at Quartz.Xml.XMLSchedulingDataProcessor.ScheduleJobs(IScheduler sched, CancellationToken cancellationToken)
at Quartz.ServiceCollectionSchedulerFactory.InitializeScheduler(IScheduler scheduler, CancellationToken cancellationToken)
at Quartz.ServiceCollectionSchedulerFactory.GetScheduler(CancellationToken cancellationToken)
The text was updated successfully, but these errors were encountered:
leonluc-dev
changed the title
Jobs created in v3 cause crash in v4
Jobs with empty JobDataMap created in v3 cause crash in v4
Jul 5, 2024
leonluc-dev
changed the title
Jobs with empty JobDataMap created in v3 cause crash in v4
Jobs with empty JobDataMap created in v3 cause exception in v4
Jul 5, 2024
leonluc-dev
changed the title
Jobs with empty JobDataMap created in v3 cause exception in v4
Several exceptions related to GetJobDetail()
Jul 5, 2024
Afaik, the
GetJobDetail()
is supposed to return null for invalid jobs. In 3.1.0 (and 4.0.0-preview.3) the GetJobDetail() method raises exceptions instead of returning null in a few cases. While this can be handled when callingGetJobDetails()
directly, it causes some internal errors during scheduler initialization as well.Scenarios:
Job class no longer exists
After removing a job class or changing its class name and restarting the scheduler, the GetJobDetail() raises an exception with the following error.
JobDataMap difference between v3 and v4
An empty JobDataMap is stored as
"{}"
in v4.0.0-preview.3 andnull
in v3.1.0. Because of this migrating from v3.1.0 to v4.0.0-preview.3 with existing jobs in the mongodb store causes the following error:The text was updated successfully, but these errors were encountered: