I have an application that uses PayPal API, which requires xerces.jar
to be in the classpath.
I want to use Quartz Scheduler in my application, so i added the necessary jars for quartz in my classpath. I want the job initialization to be done with XML
. So my configuration for Quartz is
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>
When Quartz tries to start i get the following error
[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)
If i remove xerces.jar
from my classpath, Quartz works fine without errors. But then PayPal does not work.
Any idea how i could fix it?
Thanks