“Quartz.Plugin.Xml.JobInitializationPlugin,Quartz”类型的SchedulerPlugin无法实例化 [英] SchedulerPlugin of type 'Quartz.Plugin.Xml.JobInitializationPlugin, Quartz' could not be instantiated

查看:224
本文介绍了“Quartz.Plugin.Xml.JobInitializationPlugin,Quartz”类型的SchedulerPlugin无法实例化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用quartz.net来安排工作。但是,当我运行代码时,它显示错误类型'Quartz.Plugin.Xml.JobInitializationPlugin的SchedulerPlugin,Quartz'无法实例化。



这里代码



I have used the quartz.net for scheduling the job. However, when I run the code, it is showing the error "SchedulerPlugin of type 'Quartz.Plugin.Xml.JobInitializationPlugin, Quartz' could not be instantiated".

Here the code

static void Main(string[] args)
       {

           IScheduler _scheduler = null;
           // start up scheduler`enter code here`
           // construct a factory `enter code here`
           ISchedulerFactory factory = new StdSchedulerFactory();
           // get a scheduler
           _scheduler = factory.GetScheduler();
           // start the scheduler
           _scheduler.Start();

           Console.ReadLine();
       }







这个app.config文件








This the app.config file


<configSections>
    <section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
  <quartz>
    <add key="quartz.scheduler.instanceName" value="QuartzScheduler" />
    <!-- Configure Thread Pool -->
    <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
    <add key="quartz.threadPool.threadCount" value="10" />
    <add key="quartz.threadPool.threadPriority" value="Normal" />
    <!-- Configure Job Store -->
    <add key="quartz.jobStore.type" value="Quartz.Simpl.RAMJobStore, Quartz" />
    <add key="quartz.plugin.xml.type" value="Quartz.Plugin.Xml.JobInitializationPlugin, Quartz" />
    <add key="quartz.plugin.xml.fileNames" value="~/quartzjobs.config" />
  </quartz>





这是quartzjobs.config文件





and this is the quartzjobs.config file

<?xml version="1.0" encoding="UTF-8"?>
   <quartz xmlns="http://quartznet.sourceforge.net/JobSchedulingData"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" overwrite-existing-jobs="true">

     <job>
       <job-detail>
         <name>MyJob</name>
         <group>MyJobs</group>
         <description>Logs a message to the application log</description>
         <job-type>Sample.MyJob, Sample</job-type>
         <volatile>false</volatile>
         <durable>true</durable>
         <recover>false</recover>
         <job-data-map>
           <entry>
             <key>MessageToLog</key>
             <value>Hello from MyJob</value>
           </entry>
         </job-data-map>
       </job-detail>
       <trigger>
         <cron>
           <name>MyJobTrigger</name>
           <group>MyJobs</group>
           <description>A description</description>
           <job-name>MyJob</job-name>
           <job-group>MyJobs</job-group>
           <cron-expression>0 0/1 * * * ?</cron-expression>
         </cron>
       </trigger>
     </job>

   </quartz>

推荐答案

您需要将JobInitializationPlugin替换为XMLSchedulingDataProcessorPlugin。从版本1.8开始,插件的类已更新。有关更多信息,请访问: http://quartz-scheduler.org/documentation/quartz-2。 x / cookbook / JobInitPlugin [ ^ ]
You need to replace JobInitializationPlugin with XMLSchedulingDataProcessorPlugin. Since version 1.8 the class of the plugin has been updated. More information is available here: http://quartz-scheduler.org/documentation/quartz-2.x/cookbook/JobInitPlugin[^]


如果要进入您拥有此控件的网站,并询问撰写此问题的人,而不是询问一群从未听说过的人?
How about going to the site where you got this control and asking the people who wrote it this question instead of asking a bunch of people who have never heard of it?


您必须在应用程序池中运行ASP.NET 4.0 Classic
You must run in application pool ASP.NET 4.0 Classic


这篇关于“Quartz.Plugin.Xml.JobInitializationPlugin,Quartz”类型的SchedulerPlugin无法实例化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆