mongodb-quartz-net
mongodb-quartz-net copied to clipboard
'ResetTriggerFromErrorState' does not have an implementation.
I am trying to use this package but whenever I trigger a job I get the following error:
An error occurred instantiating job to be executed. job= 'DEFAULT.FileWatcherJob, message=Method 'ResetTriggerFromErrorState' in type 'Quartz.Spi.MongoDbJobStore.MongoDbJobStore' from assembly 'Quartz.Spi.MongoDbJobStore, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.'
Quartz.SchedulerException: Problem instantiating type 'MyApp.FileWatcherJob: Method 'ResetTriggerFromErrorState' in type 'Quartz.Spi.MongoDbJobStore.MongoDbJobStore' from assembly 'Quartz.Spi.MongoDbJobStore, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.'
---> System.TypeLoadException: Method 'ResetTriggerFromErrorState' in type 'Quartz.Spi.MongoDbJobStore.MongoDbJobStore' from assembly 'Quartz.Spi.MongoDbJobStore, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
My .csproj file is as follows
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Quartz.AspNetCore" Version="3.9.0" />
<PackageReference Include="Quartz.Spi.MongoDbJobStore" Version="3.1.0" />
</ItemGroup>
</Project>
The Program.cs looks like this:
services.AddQuartz(quartz =>
{
quartz.ScheduleJob<FileWatcherJob>(
trigger => trigger
.StartNow()
.WithSimpleSchedule(schedule => schedule
.WithInterval(settings.Interval)
.RepeatForever()),
job => job.SetJobData(new JobDataMap
{
["Path"] = settings.Path,
["FileFilter"] = settings.FileFilter,
["ArchivePath"] = settings.ArchivePath,
["Username"] = settings.Username
}));
});
services.AddQuartzServer();
I am trying to use this package but whenever I trigger a job I get the following error:
An error occurred instantiating job to be executed. job= 'DEFAULT.FileWatcherJob, message=Method 'ResetTriggerFromErrorState' in type 'Quartz.Spi.MongoDbJobStore.MongoDbJobStore' from assembly 'Quartz.Spi.MongoDbJobStore, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.'
I have the same error, any news on this?
I see... it's a version problem.
For anyone coming after please note that
Quartz.Spi.MongoDbJobStore: 3.1.0 seems to be only compatible with Quartz: 3.5.0 and down.
//In your .csproj file
<PackageReference Include="MongoDB.Driver" Version="2.30.0" />
<PackageReference Include="Quartz" Version="3.13.0" />
<PackageReference Include="Quartz.Serialization.Json" Version="3.5.0" />
<PackageReference Include="Quartz.Spi.MongoDbJobStore" Version="4.0.0-preview.3" />
After hours of bs... this arrangement seems to work... hopefully they will update to the official version 4