Scheduler job in AEM6.5 not running?
I configured a scheduler in AEM6.5 like below.
In my opinion I should be getting an entry in the error.log every 2min but I am not.
I can see the SimpleScheduleTask in /system/console/configMgr
/**
* A simple demo for cron-job like tasks that get executed regularly. It also
* demonstrates how property values can be set. Users can set the property
* values in /system/console/configMgr
*/
@Designate(ocd = SimpleScheduledTask.Config.class)
@Component(immediate = true,
service = {SimpleScheduledTask.class, Runnable.class},
configurationPolicy = ConfigurationPolicy.REQUIRE)
public class SimpleScheduledTask implements Runnable {
private static final Logger LOGGER = LoggerFactory.getLogger(SimpleScheduledTask.class);
@Reference
private TagVerificationService tagVerificationService;
@ObjectClassDefinition(name = "Annotation Demo Scheduled Task - OSGi", description = "Simple demo for cron-job like task with properties")
public @interface Config {
@SuppressWarnings("squid:S00100") // Suppress naming convention warning because underscores are mapped to periods
@AttributeDefinition(name = "Expression", description = "Quartz scheduler expression to define when tokens are cleaned up")
String scheduler_expression() default "0 0/2 * * * ?";
@AttributeDefinition(name = "warnMail", description = "Address, to send the warning mail.")
String[] warnMail();
}
private SimpleScheduledTask.Config config;
@Override
public void run() {
LOGGER.trace("SimpleScheduledTask is now running");
//TODO for each article verify its tags exist
tagVerificationService.verifyTagsExist();
}
@Activate
private void activate(final Config config) {
this.config = config;
}
}