0 Replies Latest reply on Apr 30, 2008 1:21 PM by Thierry Rietsch

    Asyncronous method gets called only once

    Thierry Rietsch Newbie

      I try to implement an asynchronous method which gets initiated at startup.

      EJB with aynchronous method:

      public class ItemObserverAction implements ItemObserver {
          private EntityManager em;
          private Log log;
          public QuartzTriggerHandle observeItems(@IntervalDuration Long interval) {
           log.info("ItemObserver.observeItems at " + Calendar.getInstance().getTime());
           return null;

      The asynchronous method gets invoked for the first time during the startup of the application:

      public class StartupBootstrapAction implements StartupBootstrap {
          private ItemObserver itemObserver;
          private Log log;
          public void startApplication() {
           log.info("StartupBootstrapAction.startApplication called");
           itemObserver.observeItems(new Long(5000));

      In the components.xml i have added the async:quartz-dispatcher

      When the application runs on JBoss the quartz scheduler gets started, and the observeItem method gets called once. But unfortunately only once.

      Output of the JBoss server during deploy and startup of the ear:

      13:04:47,603 INFO  [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
      13:04:47,605 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
      13:04:47,605 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.5.2
      13:04:47,605 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
      13:04:47,620 INFO  [StartupBootstrapAction] StartupBootstrapAction.startApplication called
      13:04:47,628 INFO  [ItemObserverAction] ItemObserver.observeItems at Wed Apr 30 13:04:47 CEST 2008

      But if I continue observing the logfile, I don't see any further log entries from the ItemObserver.observeItems method. Do I have to configure something else that I get an asynchronous job up and running?