Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-3413

Unable to delete scheduled tasks that refer to classes that are not available

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: OpenMRS 1.9.0
    • Fix Version/s: Platform 2.0.0
    • Component/s: Scheduler
    • Labels:
    • Complexity:
      Low

      Description

      Modules often create scheduled tasks. When the modules are not started or are removed, the scheduled tasks typically are left behind.

      If I try to clean up and delete such a scheduled task from within the scheduler user interface, I get an error and am unable to delete the task:

      For example:

      WARN - SchedulerListController.onSubmit(130) |2012-06-07 13:39:09,704| Error processing schedulerlistcontroller task
      org.openmrs.api.APIException: '[TaskDefinition  id=116 name=Process Usage Statistics Data class=org.openmrs.module.usagestatistics.StatsAggregatorTask startTime=2011-05-22 00:00:00.0 repeatInterval=3600 secondsUntilNext=1250]' failed to validate with reason: taskClass: Class [{0}] could not be found.  Check war file and/or modules for class [{0}].
      	at org.openmrs.validator.ValidateUtil.validate(ValidateUtil.java:85)
      	at org.openmrs.aop.RequiredDataAdvice.before(RequiredDataAdvice.java:137)
      	at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:49)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at $Proxy133.saveTaskDefinition(Unknown Source)
      

      This needs to be fixed, as there is no way to remove unused scheduled tasks otherwise, except by going to the db directly.

        Attachments

          Activity

            People

            Assignee:
            fbiedrzycki Filip Biedrzycki
            Reporter:
            mseaton Mike Seaton
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: