Quartz Plugin

quartz.properties does not appear to be read.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.4.1
  • Fix Version/s: 0.4.2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Grails 1.1.1 (upgraded from 1.1), Quartz plugin 0.4.1-SNAPSHOT (upgraded from 0.3.3 to 0.4.1-SNAPSHOT and back again several times), MAC OSX 10.5 (java build 1.6.0_07-b06-153).

Description

When I change jdbcStore from false to true in QuartzConfig.groovy it starts quartz clustering fine but it appears to completely ignore quartz.properties completely, no matter where it is placed on the classpath. It instead loads the defaults provided by Quartz. I discovered this when I attempted to set

org.quartz.jobStore.tablePrefix
to something other than QRTZ_.

I found this on the mailing list: mailing list thread but couldn't find reference to it in Jira so I'm creating this ticket.

Unlike the solution proposed in the above thread I choose to workaround the issue by creating a custom BeanPostProcessor as it is really annoying trying to patch grails when you have a large team.

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import org.springframework.core.io.ClassPathResource;

public class QuartzSchedulerPostProcessor implements BeanPostProcessor {

	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		if (bean instanceof SchedulerFactoryBean) {
			SchedulerFactoryBean s = (SchedulerFactoryBean) bean;
			s.setConfigLocation(new ClassPathResource("quartz.properties"));
			return s;
		}
		return bean;
	}

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		return bean;
	}
}

Activity

Hide
Jeff added a comment -

Anybody working on this issue?

Show
Jeff added a comment - Anybody working on this issue?

People

Vote (3)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: