`
whj0427
  • 浏览: 38344 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

Quartz的配置问题

阅读更多
环境:Tomcat   6.0.10   +   Quartz   1.6.0
quartz_reminder.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE quartz PUBLIC  "-//Quartz Enterprise Job Scheduler//DTD Job Scheduling Data 1.0//EN" "http://www.quartzscheduler.org/dtd/job_scheduling_data_1_0.dtd">
<quartz>
  <job>
    <job-detail>
      <name>Job_DataTransmit</name>
      <group>DEFAULT</group>
      <job-class>scheduling.QuartzStart</job-class>
    </job-detail>
    <trigger>
      <cron>
        <name>Trigger_DataTransmit</name>
        <group>DEFAULT</group>
        <job-name>Job_DataTransmit</job-name>
        <job-group>DEFAULT</job-group>
        <cron-expression> 0 0 17 * * ? </cron-expression>
     </cron>
    </trigger>
  </job> 
</quartz>


quartz.properties :
#
# Configure Main Scheduler Properties
#

org.quartz.scheduler.instanceName = DataTransmit
org.quartz.scheduler.instanceId = one

#
# Configure ThreadPool 
#

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 5
org.quartz.threadPool.threadPriority = 4
#
# Configure JobStore 
#
org.quartz.jobStore.misfireThreshold = 5000
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
# ===========================================================================
# Configure SchedulerPlugins ===============================================
# ===========================================================================
org.quartz.plugin.triggHistory.class =org.quartz.plugins.history.LoggingTriggerHistoryPlugin
org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger{1}.{0}firedjob{6}.{5}at:{4,date,HH:mm:ssMM/dd/yyyy}
org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger{1}.{0}completedfiringjob{6}.{5}at{4,date,HH:mm:ssMM/dd/yyyy}withresultingtriggerinstructioncode:{9}
org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.JobInitializationPlugin
org.quartz.plugin.jobInitializer.fileName =/quartz_reminder.xml
org.quartz.plugin.jobInitializer.overWriteExistingJobs = false
org.quartz.plugin.jobInitializer.failOnFileNotFound = true
org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
org.quartz.plugin.shutdownhook.cleanShutdown = true


启动Tomcat加载及错误信息:
INFO : 2007-11-21 17:37:16,937: QuartzScheduler[line:542]: Scheduler QuartzSched
uler_$_one shutting down.
INFO : 2007-11-21 17:37:16,937: QuartzScheduler[line:470]: Scheduler QuartzSched
uler_$_one paused.
INFO : 2007-11-21 17:37:16,953: QuartzScheduler[line:592]: Scheduler QuartzSched
uler_$_one shutdown complete.
WARN : 2007-11-21 17:37:18,890: JobInitializationPlugin[line:140]: The "filename
" plugin property is deprecated.  Please use "filenames" in the future.
INFO : 2007-11-21 17:37:19,000: QuartzScheduler[line:209]: Quartz Scheduler v.1.
6.0 created.
INFO : 2007-11-21 17:37:19,015: ShutdownHookPlugin[line:128]: Registering Quartz
 shutdown hook.
INFO : 2007-11-21 17:37:19,015: JobInitializationPlugin[line:280]: Registering Q
uartz Job Initialization Plug-in.
INFO : 2007-11-21 17:37:19,015: RAMJobStore[line:141]: RAMJobStore initialized.
INFO : 2007-11-21 17:37:19,046: StdSchedulerFactory[line:1208]: Quartz scheduler
 'DataTransmit' initialized from default resource file in Quartz package: 'quart
z.properties'
INFO : 2007-11-21 17:37:19,046: StdSchedulerFactory[line:1212]: Quartz scheduler
 version: 1.6.0
INFO : 2007-11-21 17:37:19,484: JobSchedulingDataProcessor[line:489]: Parsing XM
L file: /D:/Tomcat/tomcat-6.0/webapps/myquartz/WEB-INF/classes/quartz_reminder.x
ml with systemId: /D:/Tomcat/tomcat-6.0/webapps/myquartz/WEB-INF/classes/quartz_
reminder.xml validating: false validating schema: jar:file:/D:/Tomcat/tomcat-6.0
/webapps/myquartz/WEB-INF/lib/quartz-1.6.0.jar!/org/quartz/xml/job_scheduling_da
ta_1_5.xsd
ERROR: 2007-11-21 17:37:26,078: Digester[line:1558]: Parse Fatal Error at line 6
 column 7: The markup declarations contained or pointed to by the document type
declaration must be well-formed.
org.xml.sax.SAXParseException: The markup declarations contained or pointed to b
y the document type declaration must be well-formed.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(ErrorHandlerWrapper.java:195)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalErro
r(ErrorHandlerWrapper.java:174)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:388)
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(X
MLScanner.java:1400)
        at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(X
MLDTDScannerImpl.java:2003)
        at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDExte
rnalSubset(XMLDTDScannerImpl.java:320)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDri
ver.dispatch(XMLDocumentScannerImpl.java:1169)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDri
ver.next(XMLDocumentScannerImpl.java:1066)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Driver.next(XMLDocumentScannerImpl.java:986)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
MLDocumentScannerImpl.java:645)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(XMLNSDocumentScannerImpl.java:140)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:807)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:737)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:107)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1205)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(SAXParserImpl.java:522)
        at org.apache.commons.digester.Digester.parse(Digester.java:1647)
        at org.quartz.xml.JobSchedulingDataProcessor.processFile(JobSchedulingDa
taProcessor.java:496)
        at org.quartz.xml.JobSchedulingDataProcessor.processFileAndScheduleJobs(
JobSchedulingDataProcessor.java:565)
        at org.quartz.plugins.xml.JobInitializationPlugin.processFile(JobInitial
izationPlugin.java:392)
        at org.quartz.plugins.xml.JobInitializationPlugin.start(JobInitializatio
nPlugin.java:324)
        at org.quartz.plugins.SchedulerPluginWithUserTransactionSupport.start(Sc
hedulerPluginWithUserTransactionSupport.java:144)
        at org.quartz.core.QuartzScheduler.startPlugins(QuartzScheduler.java:213
9)
        at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:450)
        at org.quartz.impl.StdScheduler.start(StdScheduler.java:146)
        at org.quartz.ee.servlet.QuartzInitializerServlet.init(QuartzInitializer
Servlet.java:165)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1161)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:98
1)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:4044)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
350)
        at org.apache.catalina.core.StandardContext.reload(StandardContext.java:
3083)
        at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoade
r.java:404)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBas
e.java:1279)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1571)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1580)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1580)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.r
un(ContainerBase.java:1560)
        at java.lang.Thread.run(Thread.java:619)
ERROR: 2007-11-21 17:37:26,093: JobInitializationPlugin[line:398]: Error schedul
ing jobs: The markup declarations contained or pointed to by the document type d
eclaration must be well-formed.
org.xml.sax.SAXParseException: The markup declarations contained or pointed to b
y the document type declaration must be well-formed.
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1231)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(SAXParserImpl.java:522)
        at org.apache.commons.digester.Digester.parse(Digester.java:1647)
        at org.quartz.xml.JobSchedulingDataProcessor.processFile(JobSchedulingDa
taProcessor.java:496)
        at org.quartz.xml.JobSchedulingDataProcessor.processFileAndScheduleJobs(
JobSchedulingDataProcessor.java:565)
        at org.quartz.plugins.xml.JobInitializationPlugin.processFile(JobInitial
izationPlugin.java:392)
        at org.quartz.plugins.xml.JobInitializationPlugin.start(JobInitializatio
nPlugin.java:324)
        at org.quartz.plugins.SchedulerPluginWithUserTransactionSupport.start(Sc
hedulerPluginWithUserTransactionSupport.java:144)
        at org.quartz.core.QuartzScheduler.startPlugins(QuartzScheduler.java:213
9)
        at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:450)
        at org.quartz.impl.StdScheduler.start(StdScheduler.java:146)
        at org.quartz.ee.servlet.QuartzInitializerServlet.init(QuartzInitializer
Servlet.java:165)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1161)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:98
1)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:4044)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
350)
        at org.apache.catalina.core.StandardContext.reload(StandardContext.java:
3083)
        at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoade
r.java:404)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBas
e.java:1279)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1571)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1580)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1580)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.r
un(ContainerBase.java:1560)
        at java.lang.Thread.run(Thread.java:619)
INFO : 2007-11-21 17:37:26,109: QuartzScheduler[line:455]: Scheduler DataTransmi
t_$_one started.
分享到:
评论
2 楼 zhangzhaofeng 2008-01-07  
对quartz_reminder.xml的解析出问题了
可以参见一下
JobSchedulingDataProcessor.calss
JobSchedulingDataProcessor.class
1 楼 whj0427 2007-11-22  
终于找到错误所在了,问题出在quartz_reminder.xml
<?xml version="1.0" encoding="UTF-8"?>
<quartz> 
  <job>
    <job-detail>
      <name>Job_DataTransmit</name>
      <group>DEFAULT</group>
      <job-class>scheduling.QuartzStart</job-class>
    </job-detail>
    <trigger>
      <cron>
        <name>Trigger_DataTransmit</name>
        <group>DEFAULT</group>
        <job-name>Job_DataTransmit</job-name>
        <job-group>DEFAULT</job-group>
        <cron-expression> 0 57 14 * * ? </cron-expression>
     </cron>
    </trigger>
  </job> 
</quartz>
这是修改后的文件,只需要把“<!DOCTYPE quartz PUBLIC  "-//Quartz Enterprise Job Scheduler//DTD Job Scheduling Data 1.0//EN" "http://www.quartzscheduler.org/dtd/job_scheduling_data_1_0.dtd">"删除掉即可。
不知道是不是跟Quartz的版本有关系?

相关推荐

    关于spring中quartz的配置

    以下将详细介绍如何在Spring中配置Quartz以及相关知识点。 1. **引入依赖** 在开始配置之前,首先需要在项目的`pom.xml`或`build.gradle`文件中引入Quartz和Spring相关的依赖库。对于Maven项目,可以添加如下依赖...

    完整quartz配置大全

    OpenSymphony 的Quartz提供了一个比较完美的任务调度解决方案。  Quartz 是个开源的作业调度框架,为在 Java 应用程序中进行作业调度提供了简单却强大的机制。  Quartz中有两个基本概念:作业和触发器。作业是...

    springboot整合quartz定时任务yml文件配置方式

    Spring Boot与Quartz的结合提供了便捷的配置方式,特别是通过YAML(YAML Ain't Markup Language)配置文件,使得配置更加直观和灵活。以下将详细介绍如何在Spring Boot应用中使用YAML文件配置Quartz定时任务,以及...

    Spring Quartz如何动态配置时间

    Spring Quartz 动态配置时间 Spring Quartz 是一个功能强大的任务调度框架,广泛应用于 Java 企业级应用程序中。其中一个重要的功能便是动态配置时间,触发相应的任务。在本文中,我们将讨论如何使用 Spring Quartz...

    quartz配置含表达式的事务以及集群上quartz配置

    在配置Quartz时,有时我们需要结合表达式来控制事务,同时在集群环境下,配置Quartz以确保高可用性和任务的一致性。 首先,我们来看如何在Quartz中配置含表达式的事务。在Quartz中,任务的执行是在一个事务上下文中...

    quartz 时间配置规则

    quartz 时间配置规则quartz 时间配置规则quartz 时间配置规则quartz 时间配置规则quartz 时间配置规则quartz 时间配置规则

    转:spring多个定时任务quartz配置

    本文将深入探讨如何在Spring中配置多个Quartz定时任务,并结合`quartz.properties`文件进行详细讲解。 首先,我们需要理解Quartz的基本概念。Quartz是开源的作业调度框架,允许应用程序在特定时间执行任务。它支持...

    Spring中的Quartz配置-Spring-定时器-java定时器.doc

    Spring 中的 Quartz 配置-Spring 定时器-java 定时器 在 Spring 框架中,Quartz 是一个非常流行的开源作业调度器,可以实现任务的定时执行。在本篇文章中,我们将讨论如何在 Spring 中配置 Quartz,以实现 Java ...

    quartz时间配置表达式生成工具

    quartz时间配置表达式生成工具,通界面配置生成表达式

    SpringBoot2.x quartz yml完整配置

    添加公众号:猿有一技,回复 :Spring ,获取SpringBoot2.x quartz yml完整配置

    quartz配置

    quartz 配置文件 ,很详细,带注释 ,我觉得挺好的,可以参考,够了,

    Quartz 数据库动态配置

    这就是“Quartz数据库动态配置”所解决的问题。 Quartz通过将作业(Jobs)和触发器(Triggers)的信息存储在数据库中,实现了配置的动态化。这样,我们可以在不重启应用的情况下,通过修改数据库中的表来添加、删除...

    spring多个定时任务quartz配置

    本文将深入探讨如何在Spring中配置Quartz以实现多个定时任务。 首先,我们需要理解Quartz的基本概念。Quartz是一个开源的工作调度框架,它允许应用程序定义作业(Jobs)和触发器(Triggers),以在指定的时间执行...

    对于Quartz.net 3.0.7.0(目前最高版本)的使用:能过配置文件实现工作调整

    在描述中提到的问题是关于如何在3.x版本中通过`quartz_jobs.xml`配置文件实现作业调度,这在许多教程中可能较少被提及,因为早期版本的Quartz.NET更倾向于使用XML配置,而新版本则倾向于使用代码配置或者混合方式。...

    spring quartz集群配置

    Spring Quartz 集群配置详解 在分布式系统中,定时任务的管理往往是一个重要的环节,Spring与Quartz的结合能够帮助我们实现复杂的工作调度。Quartz是一个开源的作业调度框架,它提供了高度可配置的定时任务执行能力...

    定时器(quartz+spring)读取数据库配置

    本教程将深入探讨如何使用Quartz与Spring框架结合来创建一个能从数据库读取配置的定时任务。 Quartz是一个开源的作业调度框架,它提供了丰富的API和功能,可以用来安排和执行任务。Spring框架则是一个全面的企业级...

    Spring -Quartz的配置

    本文将深入探讨如何在Spring框架中配置Quartz,以便利用其功能来执行计划的任务。 首先,我们需要理解Spring与Quartz结合的基本原理。Spring通过提供一个Quartz的JobFactory,可以集成Quartz到Spring容器中,这样...

    spring-quartz配置

    spring-quartz的标准配置文件

    Quartz CronTrigger配置说明

    ### Quartz CronTrigger配置详解 #### 一、CronTrigger简介 CronTrigger 是 Quartz 调度器中一种非常强大的任务触发机制,它基于类似于 Unix cron 的表达式来定义任务的执行时间。CronTrigger 表达式由七个或八个...

    web工程quartz的配置实例

    Quartz的配置主要通过`quartz.properties`文件进行。该文件中可以设置数据库连接、线程池大小、Job存储方式等。例如: ``` org.quartz.scheduler.instanceName = MyScheduler org.quartz.threadPool.class = org...

Global site tag (gtag.js) - Google Analytics