Quartz XMLSchedulingDataProcessorPlugin与xerces.jar冲突

时间:2013-12-04 09:25:29

标签: java paypal quartz-scheduler xerces

我有一个使用PayPal API的应用程序,它需要xerces.jar在类路径中。

我想在我的应用程序中使用Quartz Scheduler,所以我在classpath中为quartz添加了必要的jar。我希望使用XML完成作业初始化。所以我的Quartz配置是

的web.xml

...
<context-param>
    <param-name>quartz:config-file</param-name>
    <param-value>quartz.properties</param-value>
</context-param>
<context-param>
    <param-name>quartz:shutdown-on-unload</param-name>
    <param-value>true</param-value>
</context-param>
<context-param>
    <param-name>quartz:wait-on-shutdown</param-name>
    <param-value>false</param-value>
</context-param>
<context-param>
    <param-name>quartz:start-scheduler-on-load</param-name>
    <param-value>true</param-value>
</context-param>
<context-param>
    <param-name>quartz:start-delay-seconds</param-name>
    <param-value>10</param-value>
</context-param>
...
<listener>
    <listener-class>org.quartz.ee.servlet.QuartzInitializerListener</listener-class>
</listener>
...

quartz.properties

org.quartz.scheduler.skipUpdateCheck=true

org.quartz.plugin.jobInitializer.class=org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
org.quartz.plugin.jobInitializer.fileNames=quartz.xml
org.quartz.plugin.jobInitializer.failOnFileNotFound=true
org.quartz.plugin.jobInitializer.scanInterval=0
org.quartz.plugin.jobInitializer.wrapInUserTransaction=false

org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount=3

quartz.xml

<?xml version="1.0" encoding="UTF-8"?>
<job-scheduling-data
    xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_2_0.xsd"
    version="2.0">

    <schedule>
        <job>
            <name>job1</name>
            <group>JOBS_GROUP</group>
            <description>job 1</description>
            <job-class>jobs.Job1</job-class>
        </job>

        <trigger>
            <cron>
                <name>my-trigger</name>
                <group>TRIGGER_GROUP</group>

                <job-name>job1</job-name>
                <job-group>JOBS_GROUP</job-group>

                <!-- trigger every 1 minute ! -->
                <cron-expression>0 */1 * * * ?</cron-expression>
            </cron>
        </trigger>

    </schedule>

</job-scheduling-data>

当Quartz尝试启动时,我收到以下错误

[ERROR: 04/12/2013 @ 11:21:30] org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin - Error scheduling jobs: http://java.sun.com/xml/jaxp/properties/schemaLanguage
java.lang.IllegalArgumentException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
    at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setAttribute(DocumentBuilderFactoryImpl.java:118)
    at org.quartz.xml.XMLSchedulingDataProcessor.initDocumentParser(XMLSchedulingDataProcessor.java:173)
    at org.quartz.xml.XMLSchedulingDataProcessor.<init>(XMLSchedulingDataProcessor.java:159)
    at org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin.processFile(XMLSchedulingDataProcessorPlugin.java:313)
    at org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin.start(XMLSchedulingDataProcessorPlugin.java:246)
    at org.quartz.plugins.SchedulerPluginWithUserTransactionSupport.start(SchedulerPluginWithUserTransactionSupport.java:144)
    at org.quartz.core.QuartzScheduler.startPlugins(QuartzScheduler.java:2407)
    at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:568)
    at org.quartz.core.QuartzScheduler$1.run(QuartzScheduler.java:592)
    at java.lang.Thread.run(Thread.java:724)

如果我从类路径中删除xerces.jar,Quartz可以正常工作而不会出错。但是PayPal不起作用。

知道如何解决它吗?

由于

0 个答案:

没有答案