简体   繁体   English

无法在 Quartz.NET 中使用 AdoJobStore

[英]Unable to use AdoJobStore in Quartz.NET

I'm trying to use AdoJobStore for scheduling Jobs using Quartz API.我正在尝试使用 AdoJobStore 使用 Quartz API 来安排作业。

This is the content of the Application Configuration File (present as part of Windows Service).这是应用程序配置文件的内容(作为 Windows 服务的一部分出现)。

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="quartz"
             type="System.Configuration.NameValueSectionHandler" />
  </configSections>
  <quartz>
    <add key="quartz.scheduler.instanceName" value="ServerScheduler" />
    <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
    <add key="quartz.threadPool.threadCount" value="10" />
    <add key="quartz.threadPool.threadPriority" value="2" />
    <add key="quartz.jobStore.misfireThreshold" value="60000" />
    <add key="quartz.jobStore.useProperties" value="true" />
    <add key="quartz.jobStore.clustered" value="true" />
    <add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz" />
    <add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
    <add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz" />
    <add key="quartz.jobStore.dataSource" value="quartzDS" />
    <add key="quartz.dataSource.quartzDS.connectionString" value="Data Source=LocalDB;User ID=wesly;Password=XXXXX" />
    <add key="quartz.dataSource.quartzDS.provider" value="OracleClient-20 " />
   </quartz>
</configuration>

When I Start my Windows Service I m getting the following error formatted and written to logs:当我启动我的 Windows 服务时,我收到以下错误格式化并写入日志:

Exception Source: Quartz Exception Method:Quartz.IScheduler Instantiate() Exception StackTrace: at Quartz.Impl.StdSchedulerFactory.Instantiate() in c:\\Work\\OpenSource\\Quartz.NET\\quartznet\\src\\Quartz\\Impl\\StdSchedulerFactory.cs:line 1044 at Quartz.Impl.StdSchedulerFactory.GetScheduler() in c:\\Work\\OpenSource\\Quartz.NET\\quartznet\\src\\Quartz\\Impl\\StdSchedulerFactory.cs:line 1118 at SampleJobScheduling.ScheduleJob.Run() in C:\\Users\\jwesly\\documents\\visual studio 2010\\Projects\\SampleJobScheduling\\SampleJobScheduling\\ScheduleJob.cs:line 25 Exception Message: Could not Initialize DataSource: quartzDS异常来源:Quartz 异常方法:Quartz.IScheduler Instantiate() 异常 StackTrace:在 Quartz.Impl.StdSchedulerFactory.Instantiate() in c:\\Work\\OpenSource\\Quartz.NET\\quartznet\\src\\Quartz\\Impl\\StdSchedulerFactory.cs: C:\\Work\\OpenSource\\Quartz.NET\\quartznet\\src\\Quartz\\Impl\\StdSchedulerFactory.cs 中 Quartz.Impl.StdSchedulerFactory.GetScheduler() 的第 1044 行:C:\\用户\\jwesly\\documents\\visual studio 2010\\Projects\\SampleJobScheduling\\SampleJobScheduling\\ScheduleJob.cs:line 25 异常消息:无法初始化数据源:quartzDS

I'm using Oracle 11g Express Edition.我正在使用 Oracle 11g 快捷版。 Schema is WESLY架构是 WESLY

Please help !!!请帮忙!!!

I was faced this exception after using version 3 of quartz.net.在使用quartz.net 的第3 版后,我遇到了这个异常。
According to BREAKING CHANGES of Version 3;根据第 3 版的BREAKING CHANGES provider type was simplified.提供者类型被简化。
It can't read old provider type then data source is failing to initialize.它无法读取旧的提供程序类型,然后数据源无法初始化。
you should change:你应该改变:

<add key="quartz.dataSource.quartzDS.provider" value="OracleClient-20 "/>

to:到:

<add key="quartz.dataSource.quartzDS.provider" value="OracleODP" />

and you should add serializer type property like:并且您应该添加序列化器类型属性,例如:

<add key="quartz.serializer.type" value="binary" />

Because you aren't using RamJobStore .因为您没有使用RamJobStore
read about it here: Version Migration Guide在此处阅读: 版本迁移指南

I was faced the same problem with mssql configuration.我在 mssql 配置中遇到了同样的问题。 The old settings was the following:旧设置如下:

["quartz.dataSource.default.provider"] = "SqlServer-20"

I have to change to:我必须改为:

["quartz.dataSource.default.provider"] = "SqlServer",
["quartz.serializer.type"] = "binary"

Thanks nimeresam谢谢 nimeresam

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM