Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-47349

Unable to delete a scheduled task that is created without a registered destination

    Details

      Description

      Description
      Unable to delete a scheduled task that is created without a registered destination

      Steps to reproduce/Testing done

      1. Deploy my demo portlet and add it to a page.
      2. Click the Actions button
      3. Click the first option "Create Job"
      4. Notice a Destination Name has now appeared in the Destinations Section. IGNORE it for now.
      5. Notice also a new Scheduled Job has appeared. Attempt to delete it.
      6. In the server log, you will notice the "NullPointerException"
      7. Click "Create/Register" next to the Destination
      8. Again, click Delete on the Scheduled Job.
      9. Success!
        Customer quote on this issue:

        I don't think I should be able to create a Job that I then can't delete, even if the Job was malformed and didn't have a Destination registered.

      This issue was deemed a bug on LPP-11696.

      I would say that this behavior is a bug and it should be fixed in that when it hits QuartzSchedulerEngine.unregisterMessageListener, it does not throw an NPE so that it can keep going on and delete the job in QuartzSchedulerEngine.delete.
      My rationale is the following use case: Plugin1 creates a scheduled job and Plugin2 creates the destination that Plugin1's job uses. If Plugin1 is deployed first, the job should still be scheduled (this goes against what the client wants). Additionally, if Plugin2 is undeployed, the job from Plugin1 should still be able to be deleted.

      Results of Testing
      Expected behavior: The job is not created if a destination is not registered
      Actual behavior: The job is created even though a destination is not registered. Therefore it can't be deleted.

      Errors/Logs

      20:54:16,972 WARN  [liferay/scheduler_engine-1][ProxyMessageListener:81] com.liferay.portal.kernel.scheduler.SchedulerException: Unable to delete job {jobName=mil.peoavn.MyMessageListener, groupName=mil.peoavn.MyMessageListener}
      com.liferay.portal.kernel.scheduler.SchedulerException: Unable to delete job {jobName=mil.peoavn.MyMessageListener, groupName=mil.peoavn.MyMessageListener}
      	at com.liferay.portal.scheduler.quartz.QuartzSchedulerEngine.delete(QuartzSchedulerEngine.java:155)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyRequest.execute(ProxyRequest.java:85)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyMessageListener.receive(ProxyMessageListener.java:51)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:744)
      Caused by: java.lang.NullPointerException
      	at com.liferay.portal.scheduler.quartz.QuartzSchedulerEngine.unregisterMessageListener(QuartzSchedulerEngine.java:1025)
      	at com.liferay.portal.scheduler.quartz.QuartzSchedulerEngine.delete(QuartzSchedulerEngine.java:150)
      	... 11 more
      

      Reproduced...
      Reproduced in trunk? Yes (65dce37f3213fab8df1f2f4159dd0b263239ecb2)
      Reproduced in 6.2.x? Yes (1ab9e529fed9da12c3402d713e426ee94988c55a)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              linda.sui Linda Sui
              Reporter:
              andrew.betts Andrew Betts
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 21 weeks, 1 day ago

                  Packages

                  Version Package
                  6.2.2 CE GA3
                  6.2.X EE
                  7.0.0 M1