cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Meyer (JIRA)" <>
Subject [jira] Created: (COCOON-1778) NPE: QuartzJobScheduler.fireJob - needs
Date Wed, 15 Feb 2006 21:17:10 GMT
NPE: QuartzJobScheduler.fireJob - needs 

         Key: COCOON-1778
     Project: Cocoon
        Type: Bug
  Components: Blocks: Cron  
    Versions: 2.1.8    
    Reporter: Eric Meyer

calling scheduler.fireJob (for example from flow) results in an NPE if the job is a CronJob.
This is because the JobExecutionContext is created without a Trigger in the TriggerFiredBundle.
The constructor for JobExecutionContext requires that there be a trigger in the firebundle
when it calls:


on line 139.

Here is some sample flowscript that fires a CronJob.

   	var scheduler = cocoon.getComponent(;
   	try {
    } finally {

Here is a patch (license granted to ASF):

Index: C:/opt/eclipse-rc/eclipse/workspace/cocoon-svn/src/blocks/cron/java/org/apache/cocoon/components/cron/
--- C:/opt/eclipse-rc/eclipse/workspace/cocoon-svn/src/blocks/cron/java/org/apache/cocoon/components/cron/
(revision 376375)
+++ C:/opt/eclipse-rc/eclipse/workspace/cocoon-svn/src/blocks/cron/java/org/apache/cocoon/components/cron/
(working copy)
@@ -704,10 +704,12 @@
                 final JobDetail detail = createJobDetail(name, jobDataMap);
-                TriggerFiredBundle trigger = new TriggerFiredBundle(detail, null, null, false,
null, null, null, null);
+                final Trigger trigger = new SimpleTrigger(name, DEFAULT_QUARTZ_JOB_GROUP);
+                TriggerFiredBundle fireBundle = new TriggerFiredBundle(detail, trigger, null,
false, null, null, null, null);
                 final Job executor = createJobExecutor();
-                final JobExecutionContext context = new JobExecutionContext(this.scheduler,
trigger, executor);
+                final JobExecutionContext context = new JobExecutionContext(this.scheduler,
fireBundle, executor);
                 this.executor.execute(new Runnable() {
                         public void run() {

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message