• Community
  • Questions
  • Scheduled Task configured by job-config module not appearing and running in confluence

Scheduled Task configured by job-config module not appearing and running in confluence Edited

I've added a job-config module to my atlassian-plugin and added the necessary classes and registred the spring-bean. But the job does not appear in the confluence-recurring task console and the debugger never hits the execution of the scheduled-task.

I've added the following to the plugin-descriptor:

 <job-config name="Dashboard Aggregation" key="aggregator-job">
<job key="aggregationRunner" perClusterJob="true" clusteredOnly="true" />
<schedule repeat-interval="10000" />
<managed editable="true" keepingHistory="true" canRunAdhoc="true"
canDisable="true" />

i've also tried the schedule cron-expression

The implementing class is:

import java.sql.SQLException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.atlassian.scheduler.JobRunner;
import com.atlassian.scheduler.JobRunnerRequest;
import com.atlassian.scheduler.JobRunnerResponse;

public class AggregationRunner implements JobRunner{
private static final Logger log = LoggerFactory.getLogger(MngtCountQueries.class);
private AggregateDashboardData aggregateDashboardData;

public AggregationRunner(@ComponentImport AggregateDashboardData aggregateDashboardData) {
this.aggregateDashboardData = aggregateDashboardData;

public JobRunnerResponse runJob(JobRunnerRequest request) {
try {
} catch (SQLException e) {
log.error("Could not execute Scheduled Job named AggregateDashboardData cause of Database Error:" + e.getCause() + " " + e.getMessage());
return JobRunnerResponse.failed(e.getCause());
log.info("AggregateDashboardData successfully executed...");
return JobRunnerResponse.success("Successfully executed Job named AggregateDashboardData");


 and the plugin-context:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"

Confluence starts without any errors, but as written above, nothing happens.  I also tried to trigger a classNotFound exception by trying to change the job-config job-key to a other value, which is not a managed bean, but there is no such exception occuring... Is the <job key="..."> not referencing the Class implementing the JobRunner? Or how does confluence determine the class referenced by the job-config?

Thanks in advice


1 answer

1 accepted

My fault:

If confluence is not clustered, you shuldn't set clusteredOnly="true"...

 <job-config name="Dashboard Aggregation" key="aggregator-job">
<job key="aggregationRunner" perClusterJob="true" clusteredOnly="false" />
<schedule cron-expression="0 0 10 * * ?" jitterSecs="10" />
<managed editable="true" keepingHistory="true" canRunAdhoc="true"
canDisable="true" />

Suggest an answer

Log in or Join to answer
Community showcase
Maarten Cautreels
Posted yesterday in Off-topic

Friday Fun: What's your favourite beer/drink

As a Belgian, beer-lover and home brewer, beer is one of my great passions. I love the fact that with just a few ingredients (usually just water, hop and malt) you can create so many different tastes...

242 views 35 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot