JIRA plug-in development- Scheduled task reference methods

Prameesha Samarakoon January 6, 2014

Hi,

I've written a scheduled task to run on JIRA version 6.0.6(following the tutorial in the JIRA cookbook). It says to add your jar file to "WEB-INF/lib" folders and reference it in "WEB-INF/classes/schduler-config.xml " in the following manner.

<job name="ATask" class="com.a.b.APluginPackage.ScheduledTask" />

This method works fine.

What I would like to know is, if there is a way of adding the jar file to a different location, like "/jira_home/plugins/installed-plugins" location (ideally upload the jar as a plug-in and reference it in the scheduler-config.xml )and reference this from the scheduled task in the following way.

<job name="ATask" class="<full path to installed directory>com.a.b.APluginPackage.ScheduledTask" />

I've tried this method but it does not seem to work and throws the errors at startup.

/jira_home/plugins/installed-plugins/com.a.b.APluginPackage.ScheduledTask
2014-01-06 12:11:17,378 localhost-startStop-1 FATAL      [atlassian.jira.scheduler.JiraSchedulerLauncher] A RuntimeException occurred during JiraSchedulerLauncher servlet context initialisation - null.
java.lang.NullPointerException
        at com.atlassian.scheduler.SchedulerUtil.initializeAndStart(SchedulerUtil.java:28)
        at com.atlassian.jira.scheduler.JiraSchedulerLauncher.proceedIfAllClear(JiraSchedulerLauncher.java:60)
        at com.atlassian.jira.scheduler.JiraSchedulerLauncher.start(JiraSchedulerLauncher.java:27)

Is it possible to use this method or is it mandotory for the jar file to be in the WEB-INF/lib folder?

Any help would be greatly appreciated.

Thanks.

1 answer

1 accepted

0 votes
Answer accepted
Daniel Wester
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2014
WEB-INF plugins are generally plugins v1 plugins and upm plugins are v2. https://developer.atlassian.com/display/JIRADEV/Differences+between+Plugins1+and+Plugins2has more details
Prameesha Samarakoon January 6, 2014

So can a V2 plug-in be referenced from a scheduled task, and if so how should it be referenced?

Thank you very much for your prompt response.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events