8 Replies Latest reply on May 23, 2007 4:13 AM by piotr.walczyszyn

    ASync calls stays in JBoss queue after restart

    m_hess

      Hi,



      What I basically have, is just a test bean, with an ASynchronous method:

      @Local
      public interface AsyncTest {
      
       @Asynchronous
       public void runAsync(@Expiration Date firstCall, @IntervalDuration long interval);
      
      }
      


      This works fine so far. Meaning I can set a firstCall date, and an milisecond interval, so that runAsync() is called e.g. every five seconds after a initial 1 minute delay.

      Problem is, that this "Timer" (or whatever is created in the background) stays there for good. If I shut down JBoss and restart it, somewhere in the startup this timer-api seems to kick in again, and I get messages like this:

      21:10:45,223 ERROR [TimerImpl] Error invoking ejbTimeout: java.lang.RuntimeException: java.lang.IllegalStateException: Attempted to invoke a Seam component outside the context of a web application
      


      And after my applications ear has been deployed, it changes to
      21:18:05,032 ERROR [TimerImpl] Error invoking ejbTimeout: javax.ejb.EJBException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: asyncTest
      


      But note(!): A new "timer" is also created by the fresh startup, so my log also shows the test debug message I put in the implementation of runAsync(). So this gets worse with every startup that also deploys my application. So far the only way I found to get rid of this, is to delete the JBoss internal Hypersonic database in

      jboss-4.0.5.GA/server/default/data/hypersonic

      but I believe that there must be a better way to deal with this.

      I think my issue is related to the "persistent" Timers that JBoss provides, so I guess the Jboss AS forum is the place to look for help. But maybe I can fix this with some simple line in the "@Destroy/@Remove" methods?

      Thanks for insights any of you can give.

      bye, Michael