Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-6237

Karaf Scheduler reschedule failed because the function lost the job reference (After reschedule job is null)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.2.4
    • 4.3.0, 4.2.5
    • karaf

    Description

      In KarafStdScheduler the scheduleJob method remove the reference to the job from the jobDataMap.

      QuartzScheduler.DATA_MAP_CONTEXT value contains the key QuartzScheduler.DATA_MAP_OBJECT.

      jobDetail.getJobDataMap().remove(QuartzScheduler.DATA_MAP_CONTEXT);

      In QuartzScheduler the reschedule method line 261, the job reference can not be retrieve like this anymore

      Object job = detail.getJobDataMap().get(DATA_MAP_OBJECT);

      The job reference could get it like this

      final String contextKey = key.toString();

      JobDataMap karafContext = ((KarafStdScheduler)s).getStorage().get(contextKey);

      Object job = karafContext.get(QuartzScheduler.DATA_MAP_OBJECT);

      I have tested this fixed, it works fine but I'm not sure you want to implement it like this ?

      In the same time, in the same class QuartzScheduler  a typo line 57 may be fixed
      QuarteJobScheduler.Context instead of "QuartzJobScheduler.Context"

      Attachments

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              s.ricci stephane Ricci
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: