Results 1 to 2 of 2

Thread: Quartz error: IOException

  1. #1
    Join Date
    Oct 2012
    Posts
    1

    Default Quartz error: IOException

    Hi everyone,

    We recently upgraded our Quartz implementation from 1.x to 2.1.6. Among other changes, we had ro replace our references to CronTriggerBean, with the Quartz 2.1 compatible CronTriggerFactoryBean. After doing that, my app won't start. The specific error I am getting is:

    Code:
    Caused by: java.io.IOException: JobDataMap values must be Strings when the 'useProperties' property is set.  Key of offending value: jobDetail
    	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.convertToProperty(StdJDBCDelegate.java:3113)
    	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.serializeProperties(StdJDBCDelegate.java:3080)
    	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.serializeJobData(StdJDBCDelegate.java:3032)
    	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.insertTrigger(StdJDBCDelegate.java:1052)
    	at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1209)
    It appears that CronTriggerFactoryBean is sticking the jobDetail into the trigger's jobDataMap, and now Quartz is trying to serialize it and save it to the DB. Specifically, in the afterPropertiesSet() method, there is the following code:

    Code:
    if (this.jobDetail != null) {
    	this.jobDataMap.put(JobDetailAwareTrigger.JOB_DETAIL_KEY, this.jobDetail);
    }
    The old CronTriggerBean didn't do this. Any idea why it is doing this and how I can make the error go away? I don't understand why you would put the job detail into the jobDataMap. Changing the "useProperties" flag isn't an option because I need to use the jobDatMap for legitimate String data.

    Has anyone else seen this issue?

    Thanks in advance for the help!
    Joe

  2. #2

    Default

    I ran into this same bug with Spring 3.1.3 and Quartz 2.1.7 with CronTriggerFactoryBean.

    My workaround for now is a custom PersistableCronTriggerFactoryBean based on a blog post fixing the same thing for a SimpleTriggerFactoryBean
    http://site.trimplement.com/using-sp...re-properties/

    Code:
    public class PersistableCronTriggerFactoryBean extends CronTriggerFactoryBean {
    
        @Override
        public void afterPropertiesSet() {
            super.afterPropertiesSet();
    
            //Remove the JobDetail element
            getJobDataMap().remove(JobDetailAwareTrigger.JOB_DETAIL_KEY);
        }
    }
    I do have the same question though. Is there a reason for this change in the Spring classes, or is it just a bug that hasn't been reported yet?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •